Return mdb path

  • Thread starter Thread starter Douglas
  • Start date Start date
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
 
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
 
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
 
Back
Top