Capture Database Name In Access 97

DALIEN51

Registered User.
Local time
Today, 00:32
Joined
Feb 26, 2004
Messages
77
Does anyone know what VBA code I use in Access 97 to capture the mdb file name of the database I am currently in? I need to enter into a field on a table.

Any help most appreciated.

Regards,

Dalien51
 
Getting the path to the current database

For Access 97...

'returns the database file name
Dir(CurrentDb.Name)

'returns the database path
Left(CurrentDb.Name,Len(CurrentDb.Name)-Len(Dir(CurrentDb.Name)))

'returns the database path and the file name
CurrentDb.Name

'returns the directory that Access [msaccess.exe] is installed in
(SysCmd(acSysCmdAccessDir))

For Access 2000/2002/2003...

'returns the database file name
CurrentProject.Name

'returns the database path
CurrentProject.Path

'returns the database path and the file name
CurrentProject.FullName

HTH
 

Users who are viewing this thread

Back
Top Bottom