Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    May 2001
    Location
    Maryland, USA
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is there a way to edit the path of a linked table or do I have to delete the linked table and relink it from scratch?

    Thanks,
    Eric

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You can use the Linked Table Manager to change the path of a linked table.

    In Access 2000, 2002 (XP) and 2003: Tools | Database Utilities | Linked Table Manager.

    In Access 2007: activate the Database Tools tab of the ribbon. The Linked Table Manager is in the last section, Database Tools.

  3. #3
    2 Star Lounger
    Join Date
    May 2001
    Location
    Maryland, USA
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Hans. I tried that. The problem is that the address of the drive the links refers to has been changed and I'm getting an error that says, "Application-defined or object defined error." and it won't let me go any further. Sounds like I may just have to have the owners of the database delete and redo their links.

    Eric

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    If the linked table manager doesn't work it's easiest to delete and re-create the linked tables.

  5. #5
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by stuyck View Post
    Is there a way to edit the path of a linked table or do I have to delete the linked table and relink it from scratch?

    Thanks,
    Eric
    You could try a variation of the Generic Code below.
    You would need to place it in a Module and then Run it From There by Pressing F5

    IF Your Database is Running against a Secure Login, then you will need to Add the UID and PWD Parameters to the Connecction String

    IF Your Database links to MORE than one Database then that will be rather harder.

    Also, this example assumes that the database is linking ACCESS to ACCESS rather than to SQL SERVER or MYSQL etc.


    Code:
    Function ReLinkTables()
    
    Dim strNewPath as String,strDatabase as String
    Dim tdf as DAO.TableDef
    Dim strConnect as String
    
    'Enter The Database and Path Details For Relinking To Below
    strNewPath="Enter New Location To Database Here"
    strDatabase="Enter Database Name Here.mdb"
    
    If Right(strNewPath,1) <> "\" Then strNewPath = strNewPath & "\"
    
    On Error Goto NoLinkError
    'Check Folder Exists and is Accessible
    IF Dir(strNewPath & strDatabase) ="" Then
      Msgbox "Path is Invalid or FileName does not exist", vbExclamation
      Exit Function
    End If
    
    'IF the database is running as Secure then you will need to Add UID and PWD arguments to Connect String
    strConnect=";Database=" & strNewPath & strDatabase
    
    'Check Each Table for Connection String and Change and Refresh
    For Each tdf In CurrentDB.TableDefs
    	If tdf.Connect <> "" Then
                    tdf.Connect=strConnect
                    tdf.RefreshLink
    	End If
    Next
    
    Msgbox "Tables ReLinked to " & strNewPath & strDatabase
    
    Exit Function
    
    NoLinkError:
    MsgBox "Cannot Complete Table ReLinking " & vbLf & Err.Description
    Exit Function
    
    End Sub
    Andrew

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Quote Originally Posted by stuyck View Post
    ... The problem is that the address of the drive the links refers to has been changed and I'm getting an error that says, "Application-defined or object defined error." and it won't let me go any further. Sounds like I may just have to have the owners of the database delete and redo their links.
    Are you getting the error message when you first open the Linked Table Manager, or is it when you try to relink that you get the error? If you can open it and check the box that says specify a new source, then you should be able to correct the situation. If you are getting that error the moment you open Linked Table Manager, then it sounds like something may actually be corrupted in your Access front-end.
    Wendell

  7. #7
    2 Star Lounger
    Join Date
    May 2001
    Location
    Maryland, USA
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, I actually tried checking the box but I didn't have permissions on the folders the files were located in. But when I got together with the folks that did to walk them through it, they had no problems getting everything set up.

    Eric

Posting Permissions

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