Back-end path name

B

Bill

In a split mde/mdb configuration, how can I obtain
the path and name of the back-end database?

E.g., c:\MyFolder\MyBackEndData.mdb

Thanks,
Bill
 
M

MacDermott

Actually, there is nothing which limits you to a single back-end database;
different tables can be linked to different back-end files.
You can parse the location of any linked table out of the Connect property
of its TableDef.
 
B

Bill

Did a search in VBA Editor Help on "TableDef" and got a whole list
of hits, including "Connect property". However, nothing displays no
matter which item in the list I try to select.

I'm running O2K on XP-SP2.

Odd that I seem to recall having similar problems with other searches
and never did find out why sometimes Help doesn't seem to work, but
I think that's a separate subject.

Any thoughts?

Bill
 
D

Douglas J. Steele

I'm afraid I don't have a solution for your Help problem, but the answer to
your original question is:

strBackendDatabase = Mid(CurrentDb().TableDefs("NameOfLinkedTable").Connect,
11)

The reason for the Mid statement is that the Connection property will have
;Database= in front of the name.

Note that that's DAO. Access 2000 doesn't set a reference to DAO by default:
if you haven't already done so, you'll have to.

With any code module open, select Tools | References from the menu bar,
scroll through the list of available references until you find the one for
Microsoft DAO 3.6 Object Library, and select it.
 
B

Bill

Thanks Doug, your solution works perfectly. Also, thanks for thinking
beyond the statement, as I indeed had to include the DAO 3.6 Object
Library reference.
Bill
 
Top