"susan" <vd*@hotmail.co mwrote in message
news:ae******** *************** ****@cache3.til bu1.nb.home.nl. ..
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 "tblSampleForLi nk" 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().Tab leDefs("tblSamp leForLink").Con nect
;DATABASE=C:\da ta\Access\Acces s2003\A2003Test BackEnd.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