Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linked Table Source 3

Status
Not open for further replies.

paulkeys

Programmer
Sep 21, 2006
80
Hi,

I have a few linked tables in huge access databases, and i'm trying to determine the table sources.

Is there a way to access this info using vba, as i'm trying to avoid having to get access documenter installed by our desktop support bods.

Any help greatly appreciated

Cheers
Paul
 
It can be done in VBA but if you just want to take a look at the sources you can view them in the linked table manager.

Tools>Database Utilities> Linked Table Manager

HTH

I tried to have patience but it took to long! :) -DW
 
How about:

Code:
Dim tdf As TableDef
Dim db As Database

Set db = CurrentDb
For Each tdf In db.TableDefs
    If tdf.Connect <> "" Then
        Debug.Print tdf.Connect
        Debug.Print tdf.SourceTableName
    End If
Next
 
Or in a query:

SELECT [MSysObjects].[Name], IIf([MSysObjects]![Database]<>"",[MSysObjects]![Database],CurrentDB.Name) AS Location FROM MSysObjects WHERE ((([MSysObjects].[Name]) Not Like "MSys*" And ([MSysObjects].[Name])<>"tblRestrictedText") And (([MSysObjects].[Type])=1)) Or ((([MSysObjects].[Name]) Not Like "MSys*" And ([MSysObjects].[Name])<>"tblRestrictedText") And (([MSysObjects].[Type])=6)) ORDER BY [MSysObjects].[Name];

Ed Metcalfe.

Please do not feed the trolls.....
 
Cheers for the responses guys

Unfortunately i was using 97 so no linked table manager available - but the vba worked a treat.

Stars all round!

Cheers
Paul
 
Another quick way to do it is:-

Open the linked table you want to find the source in Design mode
You will get the standard "cannot edit linked table" message
Click OK to open anyway

Then: on the first field right click and select properties - the source Database path will be displayed.


Happiness is...not getting what you want but wanting what you have already got
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top