Returning database location/path

  • Thread starter Thread starter Mac
  • Start date Start date
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. :-)
 
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
 
Back
Top