"susan" <vdb@hotmail.comwrote in message
news:aed08$48450dcf$524b37b6$25507@cache3.tilbu1.n b.home.nl...
Quote:
Hi,
>
In my application I want the location of my application-database as well
as the location of my data-database to be displayed.
>
I retrieve the name of the application by:
ApplName = DBEngine(0)(0).Name
>
In the application I use links to the tables of my data-database.
How can I retrieve the location / name of the data-database?
>
DataName = <link to data-database>
|
In the Immediate Window, where "tblSampleForLink" is the name of a linked
table, the following returns the Connect property, from which you can
extract the path and name of a linked Access database.
(Caveat 1: the Connect property will differ depending on the type of
database in which the linked table resides. A linked table in SQL Server or
Oracle will have a different structure for the Connect property's string
value, for example.
Caveat 2: It is possible to link to tables in more than one database, and
if that is the case in your application, you will need to choose a table in
each, if you want to display each linked DB.)
? CurrentDB().TableDefs("tblSampleForLink").Connect
;DATABASE=C:\data\Access\Access2003\A2003TestBackE nd.mdb
My sample code is from a database created in Access 2003, but should be the
same for any previous 32-bit version of Access.
Larry Linson
Microsoft Office Access MVP