Database path

  • Thread starter Thread starter Richard Williams
  • Start date Start date
R

Richard Williams

In VBA code in Access2000 I am able to use CurrentProject.Path to refer to
the path where my front-end database is located. Is there any way that I can
obtain the path of file in Access 97? Thank you for your assistance.
 
You have to parse it out.

You can use currentdb.Name.

The above gives the full pathname, and the name of the database also.

So, normally, we could use

dim str as string
str = CurrentDb.Name

str = Left(str, InStrRev(str, "\"))
Debug.Print str

However, access97 does not have the InStrRev function either!!

So, you can use:


str = CurrentDb.Name

str = Left(str, Len(str) - Len(Dir(str)))
Debug.Print str
 
Albert D.Kallal said:
You have to parse it out.

You can use currentdb.Name.

The above gives the full pathname, and the name of the database also.

So, normally, we could use

dim str as string
str = CurrentDb.Name

str = Left(str, InStrRev(str, "\"))
Debug.Print str

However, access97 does not have the InStrRev function either!!

So, you can use:


str = CurrentDb.Name

str = Left(str, Len(str) - Len(Dir(str)))
Debug.Print str


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(e-mail address removed)
http://www.members.shaw.ca/AlbertKallal
Hi Albert
Thank you very much for your prompt reply. That's exactly the solution I was
looking for.
Regards
Richard Williams
 

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

Back
Top