Any way to access path a table is linked to?

A

Amir

go to Tools -> Add-Ins ->Linked Table Manager
-----Original Message-----
Is it possible to obtain the path that a table is linked
to in the back end? How would I do this? Is it a
property of the table?
 
M

Marshall Barton

Is it possible to obtain the path that a table is linked
to in the back end? How would I do this? Is it a
property of the table?


It's contained in the table's TableDef.Connect property

strConnect = CurrentDb.TableDefs!nameoftable.Connect

If the table it's linked to is in a Jet (Access) MDB file,
then the path statrs in the 11th character:

strPath = Mid(strConnect, 11)

If it's a different database engine then parse it out using
the InStr function. It's be right after Database= and
before the next semicolon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top