Google Groups Home
Help | Sign in
Checking Linked Tables
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
RLN  
View profile
 More options Jul 24, 11:38 am
Newsgroups: microsoft.public.access.modulesdaovba
From: RLN <R...@discussions.microsoft.com>
Date: Thu, 24 Jul 2008 08:38:01 -0700
Local: Thurs, Jul 24 2008 11:38 am
Subject: Checking Linked Tables
I have this code I got off of the web to change the table links:
<begincode>
Public Sub RelinkTables(prmNewDBPath As String)
    'Original Code
    Dim Dbs As Database
    Dim Tdf As TableDef
    Dim Tdfs As TableDefs
    Dim strMsg As String
    Set Dbs = CurrentDb
    Set Tdfs = Dbs.TableDefs

    'Loop through the tables collection
       For Each Tdf In Tdfs
        If Left(Tdf.SourceTableName, 3) = "tbl" Then
            Tdf.Connect = ";DATABASE=" & prmNewDBPath
            Tdf.RefreshLink
            strMsg = strMsg & "Linked: " & prmNewDBPath & "--" &
Tdf.SourceTableName & vbCrLf
        End If
    Next

    MsgBox " Tables Linked successfully: " & vbCrLf & vbCrLf & strMsg,
vbOKOnly + vbInformation, "ReLinkTables"
End Sub
<end code>

Before I run this to actually change the links to another .mdb, I would like
to see what db the tables are linked to before they are changed.  Is there a
simple way to check this?

Thanks....


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Klatuu  
View profile
 More options Jul 24, 3:38 pm
Newsgroups: microsoft.public.access.modulesdaovba
From: Klatuu <Kla...@discussions.microsoft.com>
Date: Thu, 24 Jul 2008 12:38:06 -0700
Local: Thurs, Jul 24 2008 3:38 pm
Subject: RE: Checking Linked Tables
The connect property of the tabledef object contains the path to the mdb that
contains the linked table.

So in your code Here:
       For Each Tdf In Tdfs
         Debug.Print "Table " & tdf.Name & " Connection is " & tdf.Connect
        If Left(Tdf.SourceTableName, 3) = "tbl" Then

--
Dave Hargis, Microsoft Access MVP


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
RLN  
View profile
 More options Jul 24, 4:14 pm
Newsgroups: microsoft.public.access.modulesdaovba
From: RLN <R...@discussions.microsoft.com>
Date: Thu, 24 Jul 2008 13:14:03 -0700
Local: Thurs, Jul 24 2008 4:14 pm
Subject: RE: Checking Linked Tables
This worked great!  thank you so much.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google