Access 2007 - Where is the database path?

T

TheBrenda

I often have an Access 2007 database open, make a change, and get confused
about what copy of the database do I have open? Is it the client's copy, my
local copy, the server copy, etc. How can I find the database path?
 
B

Banana

TheBrenda said:
I often have an Access 2007 database open, make a change, and get confused
about what copy of the database do I have open? Is it the client's copy, my
local copy, the server copy, etc. How can I find the database path?

Try CurrentDb.Name, if my memory serves.

(If you are not sure what this is, go to VBA Editor, press ctrl+G to
open immediate windows which usually shows on bottom half of screen,
then type in this:

?CurrentDb.Name

and the path should be printed out in the immediate windows.
 
D

Dirk Goldgar

TheBrenda said:
I often have an Access 2007 database open, make a change, and get confused
about what copy of the database do I have open? Is it the client's copy,
my
local copy, the server copy, etc. How can I find the database path?


In the Immediate Window (activated by pressing Ctrl+G), enter

?CurrentProject.Path

or

?CurrentDb.Name

The former will give you the folder path of the current database, while the
latter will give you the full path and file name.
 
T

TheBrenda

I want to know how to get the path from within the access.exe. I want a
solution that is also appropriate for my non-programmer, Q&A team member.
 
H

Hans Up

TheBrenda said:
I want to know how to get the path from within the access.exe. I want a
solution that is also appropriate for my non-programmer, Q&A team member.

Create a command button on a form. From the command button's
properties, choose the On Click event, select "[Event Procedure]", click
the 3 dots and place this code in the procedure:

MsgBox "This database: " & Currentdb.Name

Alternatively, you could assign Currentdb.Name to an unbound text box on
a form.
 
T

TheBrenda

I am not being clear - sorry. While I am in Access, how can I tell the
database path and filename.mdb? If I was in Word, i would do SAVE AS and see
the path that was the default in the Save As dialog form. I do not need it
for any programming purpose. Just sometimes we get confused about which copy
of the database have open and I have to go looking for the one with the ldb
file extension.

Hans Up said:
TheBrenda said:
I want to know how to get the path from within the access.exe. I want a
solution that is also appropriate for my non-programmer, Q&A team member.

Create a command button on a form. From the command button's
properties, choose the On Click event, select "[Event Procedure]", click
the 3 dots and place this code in the procedure:

MsgBox "This database: " & Currentdb.Name

Alternatively, you could assign Currentdb.Name to an unbound text box on
a form.
 
H

Hans Up

TheBrenda said:
I am not being clear - sorry. While I am in Access, how can I tell the
database path and filename.mdb? If I was in Word, i would do SAVE AS and see
the path that was the default in the Save As dialog form. I do not need it
for any programming purpose. Just sometimes we get confused about which copy
of the database have open and I have to go looking for the one with the ldb
file extension.

Then I don't understand. What is wrong with a command button to inform
your non-programmer team members about the folder and file name of the
database they are currently using?

Neither you nor they have to use that information for any programming
purpose. Just look at to see which database is being used.
 
T

TheBrenda

We have a handful of programmers and a handful of Q&A staff. Several hundred
clients that each have their own databases. I am in no position to implement
nor enforce that each database has a form with a button. Whenever we are
talking in a group, doing customer support, whatever - when there is a issue
we start to debate are they pointing to the right database and what is in the
database and then before long we have a couple of databases open and so it
goes from there. So are we saying that there is no way from with the Access
user interface to know what database you have open?
 
A

Albert D. Kallal

So are we saying that there is no way from with the Access
user interface to know what database you have open?

Well, how did they open this in the first place? In other words, how can
they open something without knowing it?

I mean, how do they know what word document is open? How do they find this
out now?

You can also use the save-as in ms-access to find this out, but it sure
seems like a bad way to accomplish this goal.

The ctrl-g, and typing in

? currendb.Name

Is likely the best was to accomplish this goal. In fact, it better then what
most in word do (what do your word users use?).

Seems to me ms-access is far better in this regards. As also mentioned, if
it
is important, then why not make this a coding and programming standard in
your startup form and display the application + path name in the
bottom part startup form. (it not take up much room).
 
T

TheBrenda

"You can also use the save-as in ms-access to find this out, but it sure
seems like a bad way to accomplish this goal. "

Albert, which File Save As option would I use to see the path of the current
database?
 
H

Hans Up

TheBrenda said:
We have a handful of programmers and a handful of Q&A staff. Several hundred
clients that each have their own databases. I am in no position to implement
nor enforce that each database has a form with a button. Whenever we are
talking in a group, doing customer support, whatever - when there is a issue
we start to debate are they pointing to the right database and what is in the
database and then before long we have a couple of databases open and so it
goes from there. So are we saying that there is no way from with the Access
user interface to know what database you have open?

I can say I don't know of any way to do it from the interface.

Good luck.
 
T

Tom

I don't have A2007 at the machine I'm using right now - only A2003.
However, in A2003 there is a File:Database Properties item that will
tell you the path to the database (along with alot of other semi-
useless information). There may be something similar in Access2007.

Alternately (and again in A2003) if you go to
Tools:Analyzer:Documenter and select the Current Database tab, then
check either (or both) of the elements there, then click OK - you will
get a report that includes the path and file name at the top.

Be aware though - both of these only tells you path to the file that
is open. If you have linked tables, it will not tell you where the
tables are, only where the front end is. The fact that you say
"pointing to the right database" makes me think you may have a split
DB design with linked tables. In which case you have a mess - but
then you knew that already...
 
P

Paul Shapiro

Tom said:
I don't have A2007 at the machine I'm using right now - only A2003.
However, in A2003 there is a File:Database Properties item that will
tell you the path to the database (along with alot of other semi-
useless information). There may be something similar in Access2007.

Alternately (and again in A2003) if you go to
Tools:Analyzer:Documenter and select the Current Database tab, then
check either (or both) of the elements there, then click OK - you will
get a report that includes the path and file name at the top.

Be aware though - both of these only tells you path to the file that
is open. If you have linked tables, it will not tell you where the
tables are, only where the front end is. The fact that you say
"pointing to the right database" makes me think you may have a split
DB design with linked tables. In which case you have a mess - but
then you knew that already...


The Database Properties is still there in Access 2007. From the Office
Button choose Manage in the left pane and then Database Properties in the
right pane. The General tab of the Properties dialog has the Location.
 
A

Albert D. Kallal

TheBrenda said:
"You can also use the save-as in ms-access to find this out, but it sure
seems like a bad way to accomplish this goal. "

Albert, which File Save As option would I use to see the path of the
current
database?

You will not see the full path, you will see the current directory (and then
hitting the up arrow in the dialog will allow you to traverse back up
through the folder list...which mans you can deduce the full path name)..

It was only a suggestion that you CAN USE the similar approach that people
use when in word.

I suspect that many people use this trick in word. Thus, this is why I asked
what do your word users do right now? -- if they have a LONG TIME tradition
of using the save-as trick, then it is possible suggestion to do that in
ms-access, however, it is not an ideal suggestion as it does not display the
full path, but you have to "figure" the path by repeatedly hitting the up
arrow in the browse dialog box.

I think at the end of the day the ctrl-g and entering ? currentdb.name is
likely the best. And, if this is REALLY an issue, then as mentioned adopting
a coding standard in which you display this information in the startup form
(switchboard or main application form) is likely the BEST suggestion here.

So, the save as does not display the full path name, but does allow you to
get the full path name and this is perhaps what your users are familiar with
in regards to word, excel. How well this suggestion works will depend on
your users now and what they do for other office applications
 
D

David W. Fenton

You will not see the full path, you will see the current directory
(and then hitting the up arrow in the dialog will allow you to
traverse back up through the folder list...which mans you can
deduce the full path name).

Save As in versions before 2007 would only save the currently
selected object, so that's an important distinction.

Seems to me that Database | Properties on the FILE menu is the best
way to do this, though with long paths, they'll have to scroll
right/left in a textbox that's not obviously scrollable.
 

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