Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2003
    Posts
    14

    Red face Unanswered: how to use refreshlink

    Hi,
    I am trying to dynamicaly reconnect a table linked to a text file when a user opens the mdb. I think that my best bet will be to use the RefreshLink method and I was wondering if anybody had an example of how to use it. I have very little VB/VBA experience and am stuck...
    Thanks,
    Mike

  2. #2
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168
    I was in the middle of finding some code to put on here when I started wondering.

    Does the link not refresh when someone opens the database automatically?
    J.

  3. #3
    Join Date
    Feb 2003
    Posts
    14

    Unhappy

    The problem is that the data file and the mdb are moved by the users to different locations and the path to the file is not refreshed when they are moved.

  4. #4
    Join Date
    Feb 2003
    Posts
    14

    bump

    Still no answer...... PLEEEAASE HHHHEEELLLPPPP. I am really stuck and I have been digging into the MSDN and am getting overwelmed.. If anybody as any example, it would seriously help. Thanks

  5. #5
    Join Date
    Feb 2003
    Posts
    27
    Check this link. It has some info about RefreshLink

    http://www.experts-exchange.com/Data..._10109049.html

  6. #6
    Join Date
    Apr 2002
    Posts
    139
    You could also have a look at

    http://www.mvps.org/access/tables/tbl0009.htm

    hth

  7. #7
    Join Date
    Nov 2002
    Location
    San Francisco
    Posts
    251
    this code goes through all tables and changes LINK into new mdb (the tables which need to be refreshed start with TBL e.g. TBLOrders) - you can easily change that, the code checks if the table IS currently linked to MyMDB.mdb and i yes, it re-links it.

    I used it because I had special export.mdb un users' desktops ...

    strMyMDB = "MyTable.mdb"
    strMyNewMDB = "C:\test\" & strMyMDB

    For Each strTable In CurrentDb().TableDefs
    If Left(strTable.Name, 3) = "tbl" Then
    If InStr(strTable.Connect, strMyMDB) > 0 Then
    strTable.Connect = ";DATABASE=" & strMyNewMDB
    strTable.RefreshLink
    End If
    End If
    i = i + 1
    Next



    jiri

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •