Does anybody know how I get the full path to the Currentdb.
If I use currentdb.name I get the old DOS format which can't hold more than 8 cahracters per directory. If it ios longer is has a ~ in the name.
Public Function GetPath() As String
' Give path without last "\"
Dim X, Y As Byte
Set dbCurrent = CurrentDb
Do
X = Y
Y = InStr(X + 1, dbCurrent.Name, "\"
Loop Until Y = 0
GetPath = Left(dbCurrent.Name, X - 1)
End Function "In three words I can sum up everything I've learned about life: it goes on."
- Robert Frost 1874-1963
Not really OS Dependant, two functions get their data the same way, only the stuff that's done with it differs a bit.
(Matter of copy/paste in my case)
Main thing is that in CurrentDb().Name you find the full database path.
"In three words I can sum up everything I've learned about life: it goes on."
- Robert Frost 1874-1963
Thanks for your answers, but when I use
currentdb.name I get something like this:
C:\WORKBE~1\PRODVE~1\coda 97.mdb instead of
C:\WORKBENCH\PRODVERSION\coda 97.mdb.
I'm running Windows NT 4.0.
Could that be the problem ?
Tried it as well on a NT4.0 and it gave me just the full path.
Sorry, no idea why it doesn't in y'r case "In three words I can sum up everything I've learned about life: it goes on."
- Robert Frost 1874-1963
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.