Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8431535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:52:51+00:00 2026-06-10T05:52:51+00:00

I have a directory of databases (*.mdb)s which are linked to several other *.mdb

  • 0

I have a directory of databases (*.mdb)s which are linked to several other *.mdb in other locations.

We’ve split the original database from one file into two partitions. The databases in the directory point to the original database file (and a few other databases as well). Now I need to re-link the tables from each database in the directory to the correct partition of the original (now split) database.

I’ve been going through manually and re-linking the tables in each database’s Linked Table Manager, but this is grossly inefficient, and if I could just query the Linked Table Manager somehow, I could easily find out if I have changed the correct number of tables.

Is there any way to query the Linked Table manager? Through VB or even using the system tables and SQL using table name and file location?

Note I am opening the files in MS Access 2003, but MS Access 2003 is opening them and reporting Access 2000 format.

Per Remou’s suggestion here is some code I wrote to relink the tables:

Sub RelinkLinks()
    Dim db As Database
    Dim tdf As TableDef

    Dim OldLoc As String
    OldLoc = ";DATABASE=\\lois\_DB\DB\BE.mdb"

    Dim partition1Loc As String
    Dim partition2Loc As String
    partition1Loc = ";DATABASE=\\lois\_DB\DB\Partition 1\BE.mdb"
    partition2Loc = ";DATABASE=\\lois\_DB\DB\Partition 2\BE.mdb"

    Set db = CurrentDb

    For Each tdf In db.TableDefs

        ' Only cycle through the locations
        ' that are equal to the old one...
        If tdf.Connect = OldLoc Then
            ' Debug.Print tdf.Name & ":" & tdf.Connect

            Dim whichLoc As String

            If tdf.Name = "T_PAR_2_TBL_1" Or tdf.Name = "T_PAR_2_TBL_2" Then
            ' Only set the tables to partition 2 that were listed as in Partition 2 by the database splitter
                Debug.Print "Setting linked table " & tdf.Name & " FROM " & tdf.Connect & " TO " & partition2Loc
                whichLoc = partition2Loc
            Else
            ' If the name was not listed as in partition 2, set it to partition 1
                Debug.Print "Setting linked table " & tdf.Name & " FROM " & tdf.Connect & " TO " & partition1Loc
                whichLoc = partition1Loc
            End If

            'We will uncomment this when we take the safety off...
            'tdf.Connect = whichLoc
            'tdf.RefreshLink
        End If
    Next tdf
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:52:53+00:00Added an answer on June 10, 2026 at 5:52 am

    You can change and update links by referring to the TableDefs through VBA.

     Set db = CurrentDB
     For Each tdf In db.Tabledefs
     If tdf.Connect <> Myconnect Then ''the connect property is a string
        tdf.Connect = MyConnect
        tdf.RefreshLink
     End If
    

    You can also link all tables in an external database with VBA by using CreateTableDef. I generally find it useful to keep a table of tables I want to link and use that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

guys, I have the problem when copying database from local assets folder to /data/data/package_name/databases
We have one .exe application that uses one .mdb Microsoft Access database. I need
I have a legacy VB6 program which installs an Access file in a sub-directory
I have a database (mdf file) which I'm approaching with the Entity Framework. Is
Currently I have Windows App which is directly opening database connection (SQL Server is
I have directory A with files matching directory B. Directory A may have other
I'm confused with file moving under python. Under windows commandline, if i have directory
I have several files with code testing code (which uses a unittest class). Later
The DBA's want to know which databases I'm supporting. I haven't found what database
I am attempting to connect to an Access 2000 database file (*.mdb), but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.