Returning database location/path

M

Mac

I see that by looking in the "General" tab of
the "Database Properies" option in the File Menu, that the
database is aware of it's Location...

I was wondering if there is some kind of function that
returns the currect location (path) of the database file
that is being viewed (eg. as a string so it can be used in
coding).

For example, if the "Northwind.mdb" file is on the Desktop
it will return a reference to the desktop -- C:\Desktop.
However, if the file is ever moved to a different
directory, it would return a reference to that directory --
C:\NewDir -- without the user ever having to specifically
look it up.

Any Ideas??

Thanks. :)
 
B

Brendan Reynolds \(MVP\)

Some examples typed into the Immediate window ...

? currentdb.Name
C:\Documents and Settings\Brendan Reynolds\My Documents\db1.mdb

? left$(currentdb.Name,len(currentdb.Name)-len(dir(currentdb.Name)))
C:\Documents and Settings\Brendan Reynolds\My Documents\

? currentproject.FullName
C:\Documents and Settings\Brendan Reynolds\My Documents\db1.mdb

? currentproject.Name
db1.mdb

? currentproject.Path
C:\Documents and Settings\Brendan Reynolds\My Documents
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top