Results 1 to 3 of 3
  1. #1
    Needlejockey is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Apr 2012
    Location
    Netherlands
    Posts
    9

    Re-attaching backend db after drive change

    I have a big (reasonably big) Access 2003 db which I have split. On the E: drive this functions perfectly. Years ago I moved it to an other drive and found that to reach the back end again I had to change the drive letter in the link to the tables. Unfortunately I can't remember how I did it - all I remember is that somehow I brought up the link path and could then simply change the drive letter. I now find it necessary to put the db on an external drive for use with different computers. It will probably be easiest to put ".\" instead of a drive letter in the link, but after trying all menu options for db, tables and macros I still haven't found out how to access the link path. Can anyone help, please? John

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Right click on table to open the table link manager.

    Or use code to set links. Recommend UNC pathing. Here is what I use:
    Code:
    Public Sub NormalizeTableLinks()
    'Relink tables with UNC pathing
    'Use the variables provided to do the manipulations desired
    Dim td As TableDef
    Dim db As DAO.Database
    Dim strOld As String
    Dim strNew As String
    'replace the following strings as needed
    strOld = "R:\Lab\Database\Data\LabData.accdb"
    strNew = gstrBasePath & "Data\LabData.accdb"
    Set db = CurrentDb
    For Each td In db.TableDefs
        If InStr(td.Connect, strOld) > 0 Then
            Debug.Print td.Name
            Debug.Print "Old Link: " & td.Connect
            td.Connect = Replace(td.Connect, strOld, strNew)
            td.RefreshLink
            Debug.Print "New Link: " & td.Connect
        End If
    Next td
    db.TableDefs.Refresh
    End Sub
    gstrBasePath is a global constant declared in a general module header. The path string is in the form: \\servername\path\
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Needlejockey is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Apr 2012
    Location
    Netherlands
    Posts
    9
    June7, thanks very much indeed. The table link manager did the trick, I wonder why I had not found that earlier. I'll have a good look at your code and add it to my snippets collection as well as to the current db. Thanks again. John

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-01-2012, 09:06 AM
  2. Replies: 1
    Last Post: 01-01-2012, 12:08 AM
  3. Replies: 1
    Last Post: 04-11-2011, 12:34 PM
  4. Attaching Files
    By jlclark4 in forum Forms
    Replies: 7
    Last Post: 01-20-2011, 03:01 PM
  5. How to change drive letter in input form
    By Vernon27 in forum Access
    Replies: 16
    Last Post: 06-09-2010, 12:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums