Which table is linked? (1 Viewer)

ListO

Señor Member
Local time
Today, 14:33
Joined
Feb 2, 2000
Messages
162
I'm working with a split database. I frequently change the b/e link to different .mdb files. Sometimes it's because I'm debugging or testing changes to the front end, sometimes it's because I'm working with data from different projects.

I thought it would be nice if I could display the name of the currently-linked back-end .mdb file on a form. I've been unable to find a way to return to a variable the name of the b/e file.

Any suggestions?

I'm using Access 97 (still) on Windows XP Pro.
 

FoFa

Registered User.
Local time
Today, 08:33
Joined
Jan 29, 2003
Messages
3,672
Basically you can loop through the tabledefs, and detect the connect property being filled in, and use that property to determine what it is linked to.
 

ListO

Señor Member
Local time
Today, 14:33
Joined
Feb 2, 2000
Messages
162
Thanks

for the starter. It took some figgerin, but here's the (pretty simple) code I came up with, which returns the name of the source database for the table called "Cues."


Public Function FindSource(dbname As String)
Dim dbs As Database, tdf As TableDef
Set dbs = CurrentDb
Set tdf = dbs.TableDefs("cues")
dbname = tdf.Connect
End Function


dbname becomes the full pathname and .mdb file name.

-Curt
 

Users who are viewing this thread

Top Bottom