Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2006
    Posts
    47

    Unanswered: Linking to tables through a shortcut

    We are splitting a share drive into 2 locations and I am looking for a way to avoid re-mapping all of our Access Databases.

    Currently we have 2 paths through one drive letter with a ton of linked databases.

    R: currently is \\server1\share1

    R:\Folder1
    R:\Folder2

    We need to move Folder2 to a new share location. I tried creating a shortcut folder in the new location to Folder1 but it Access couldn't find the location.

    R: will be \\server2\share2 but Folder1 is still on \\server1\share1

    R:\Folder1 (as a shortcut)
    R:\Folder2 (re-mapped to the new share)

    I looked through some of the VBA to automate the re-mapping but would prefer to keep the pathing the same as we need the Databases to go back and forth between the 2 shares seemlessly.

    Any help or guidance would be greatly appreciated.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Refreshing the links is not very difficult:
    Code:
    Function RefreshAttachments(NewLink as String)
    
        Dim tdf as DAO.TableDef
    
        For Each tdf In CurrentDb.TableDefs
            If Len(tdf.Connect) Then
                tdf.Connect = NewLink
                tdf.RefreshLink
            End If
        Next tdf
        
    End Function
    If the remote database moves frequently between two locations, you could create a logical disk and change it's mapping as necessary, without beeing obliged to redefine the attachments in the front-end.

    Have a nice day!

Posting Permissions

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