Return mdb path

D

Douglas

How do I return the path of the current mdb. I am going
to use this returned path value to test it against a table
in the database that has a field with the path of where
the path should be to stop someone from copying the mdb to
their hardrive and opening the mdb there. I tried CurDir
() but that did not return the correct path of the mdb
file I had just opened.

Thanks,

Douglas
 
J

John

Douglas said:
How do I return the path of the current mdb. I am going
to use this returned path value to test it against a table
in the database that has a field with the path of where
the path should be to stop someone from copying the mdb to
their hardrive and opening the mdb there. I tried CurDir
() but that did not return the correct path of the mdb
file I had just opened.

Thanks,

Douglas


Try CurrentProject.Path

Greetings John


http://members.home.nl/jpeskens
 
D

Douglas J. Steele

CurrentDb().Name will return the complete path to the database: you can get
just the path using

Left(CurrentDb().Name, Len(CurrentDb().Name) - Len(Dir(CurrentDb().Name)))

Alternatively, if you're using Access 2000 or newer, you can also use
CurrentProject.Path
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top