Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Current Path? 1

Status
Not open for further replies.

danomaniac

Programmer
Jan 16, 2002
266
0
0
US
I'm having difficulty getting the actual path that my database resides in. I want to be able to get the current directory when the main form loads then use it as my starting reference to add sub folders to, ie. '\images' , etc.
I use the CurDir and I get the default directory, not the actual directory the database is residing in. I've done this before, but can't remember how.

Thanks for any help.

"It's more like it is now, than it ever has been."
 
Hello

I use the below function;

Function CurrentDBDir(strDBPath As String, strDBFile As String) As String

CurrentDBDir = Left(strDBPath, Len(strDBPath) - Len(strDBFile))

' WHERE
'strDBPath = CurrentDB.Name
'strDBFile = Dir (CurrentDB.Name)

End Function

Regards

[afro2]
 
Hi!

ploeryan's version is the dao variant. Using access 2000+ and ado;

[tt]currentproject.path[/tt]

Roy-Vidar
 
Thanks - exactly what I needed.

"It's more like it is now, than it ever has been."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top