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

Programatically determine path to linked tables 3

Status
Not open for further replies.

thendrickson

Programmer
Apr 14, 2004
226
0
0
US
Is there a way to read the current path for a linked table programatically? (Using VBA)

If so, how would I go about it?

I would have thought one of the systems tables would contain the path, but that does not seem to be the case.

Currently I am using Access 97, but once the updates are distributed, the users will run 97 or convert the database to Access 2000 on first use. Some might have Access 2003 as well.

So I am also hoping that I can use identical code in at least 97 and 2000 versions. (I am still an optimist :)), but can find a work around if this is not the case.



 
currentdb.tabledefs("tablename").connect
will give you the link table type and the full path.
You can then get just the path usinga mid() command.
 
Here's a freebie (assumes that all linked tables reside in the same file):


Set DB = CurrentDb

For Each Tdf In DB.TableDefs
If Len(Tdf.Connect) Then
strExternalMdb = Tdf.Connect
Exit For 'One table is sufficient
End If
Next



Jeff Roberts
Insight Data Consulting
Access and SQL Server Development
 
Thanks for the help and quick response.

You guys have saved my rear again.

The linked tables may not all reside in the same file which is why I need to find the path programatically.

I am creating a live update to update current users who may have any number of older versions with linked tables that may be in any number of locations and contained in any number of MDB files (at least one case has 7 seperate mdb files containing tables)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top