vedran
12-11-2006, 02:25 PM
Hi,
I'm looking for function whitch returns path of current mdb Access file running.
For file started from d:\bla\bla\base.mdb returns
d:\bla\bla\
Thanks
pnjones
12-11-2006, 03:05 PM
Function CurrentDBDir() As String
Dim strDBPath As String
Dim strDBFile As String
strDBPath = CurrentDb.Name
strDBFile = Dir(strDBPath)
CurrentDBDir = Left(strDBPath, Len(strDBPath) - Len(strDBFile))
End Function
boblarson
12-11-2006, 03:09 PM
It is quite simple really if you have Access 2000 or above:
CurrentProject.Path
Cosmos75
12-12-2006, 12:44 AM
File Name, File Path, And Microsoft Access Version Number Of Current Database File And Microsoft Access Application (http://www.accessdb.info/content/view/89/45/)
ghudson
12-12-2006, 06:10 AM
That Search button really does work.
Getting the location to the current database using 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
Getting the location to the current database using 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))