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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What DB is my LINKED TABLE Linked to?? 2

Status
Not open for further replies.

shannonp

IS-IT--Management
Nov 13, 2001
289
NZ
I have some VB code that populates a listbox with my tables...I would like to add a column to the listbox so it shows what .mdb file each table is linked to (or not).

Example:

"TableName1", "Linked to C:\DB1.mdb"
"TableName2", "Linked to C:\DB1.mdb"
"TableName3", "Linked to C:\DB1.mdb"
"TableName4", "Linked to C:\DBa.mdb"
"TableName5", "Not Linked (Local)"
"TableName6", "Linked to C:\DBx.mdb"
...

So basically, how do I refer to the above second column values using VB?? I can easily go to the "table link manager" to find this out but I want a total VB way of doing it.

Thanks


[yinyang]
 
You won't find this documented but it works. Create a query with the sql:
SELECT msysobjects.Name, msysobjects.Database
FROM msysobjects
WHERE (((msysobjects.Type)=6));

Duane
MS Access MVP
 
If you're like me, and your linked tables are linked via a DSN, you might try .Type=4.

Good luck.
 
You can also use Connect property for TableDef,
like:
CurrentDb.TableDefs(&quot;<table name>&quot;).Connect
For Access linked table you get something like:
;DATABASE=<path>\Db1.mdb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top