Results 1 to 6 of 6
  1. #1
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904

    Linked Tables and UNC


    I have an automated database. It is usually run off of a scheduler, but sometimes I need to kick it off manually from my computer.

    My issue is that the server that the scheduled job runs from has different drive mappings than my personal computer. This is creating an issue with many linked tables I have set up (this is NOT a split database set-up, I have links to 15 different databases). 14 of these databases are found in the same path (these are various .dbf files), and the last one resides in a different folder (this is another .accdb Access database).

    If I could set up these links to use UNC, everything would work fine. But alas, that does not appear to work. Access seems intent on assigning a drive letter to each one. Does anyone know how I can accomplish this?

    I have been searching around the web, but most of what I have found refers to split Access databases (so every table is linked to a single known database name), or require user interaction at run-time (prompts), which wouldn't work for an automated job. I'll keep searching, but if anyone can help point me in the right direction, it would be greatly appreciated!

    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    How are you linking? I just tested and had no problem linking with a UNC path (2007). If you browse through a mapped drive, Access will link it that way. You probably have to browse through Network Places or type in the path.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I use VBA to assign UNC path to table links. Review http://forums.aspfree.com/microsoft-...ue-323364.html
    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.

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    How are you linking? I just tested and had no problem linking with a UNC path (2007). If you browse through a mapped drive, Access will link it that way. You probably have to browse through Network Places or type in the path.
    I was doing it through the Linked Table Manager. I had thought the same thing, and had tried going through "Network Places", but for whatever reason, it didn't seem to stick. I suspect that I must have done something wrong, because I tried again, and it worked the second time.
    I place the blame on "Monday"...


    I use VBA to assign UNC path to table links. Review http://forums.aspfree.com/microsoft-...ue-323364.html
    June, thanks for your reply too. It is good to see how to do that too, as I may have a need for that someday.

    Thanks all!

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Dang Mondays!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Link in post 3 is dead. Here is the code it presented:
    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
    
    
    'change Excel sheet connection string to enable data edit
    ''strOld = "IMEX=2"
    ''strNew = "IMEX=0"
    
    
    'replace the following strings as needed
    strOld = "C:\"
    strNew = "\\YourURL\path"
    
    
    Set db = CurrentDb
    For Each td In db.TableDefs
        If td.Connect <> "" Then
            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
        End If
    Next td
    db.TableDefs.Refresh
    
    
    End Sub
    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.

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

Similar Threads

  1. How about linked Tables with Sharepoint?
    By Steven.Allman in forum SharePoint
    Replies: 0
    Last Post: 04-09-2012, 06:55 AM
  2. Replies: 5
    Last Post: 02-02-2012, 06:42 PM
  3. Linked Tables
    By kwooten in forum Access
    Replies: 3
    Last Post: 09-27-2011, 12:08 PM
  4. Help with Linked Tables
    By softspoken in forum Forms
    Replies: 22
    Last Post: 03-25-2010, 09:35 AM
  5. help with linked tables
    By davidoakley in forum Access
    Replies: 9
    Last Post: 06-17-2009, 05:23 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