Finding path which working currently mdb (1 Viewer)

G

guiderec

Guest
Hi,

I need to help immediately. I search about finding pth which currently open MDB file's but help didn't helped me.

Im a new programmer on Access&Visual B.

please help me.

Thanks.

If you'll send mail tome i ll be thanksful you.
Recai YAGLI : yaglir@hotmail.com
 

scottfarcus

Registered User.
Local time
Today, 15:46
Joined
Oct 15, 2001
Messages
182
Dim db As DAO.Database
Dim strPath As String
Dim intCharacter As Integer

Set db = CurrentDb

strPath = db.Name
intCharacter = InStrRev(strPath, "\")
strPath = Left(strPath, intCharacter)

'Use this code block to retrieve the path or the current database.
 

boblarson

Smeghead
Local time
Today, 07:46
Joined
Jan 12, 2001
Messages
32,059
For Access 2000 you can use:

CurrentProject.Path

For Access 97 you can use

CurrentDb.Name

Easier than the code above :)

BL
hth
 

scottfarcus

Registered User.
Local time
Today, 15:46
Joined
Oct 15, 2001
Messages
182
The code I provided will remove the database name and provide you with ONLY the directory structure. bob's will include the db name at the end.
 

boblarson

Smeghead
Local time
Today, 07:46
Joined
Jan 12, 2001
Messages
32,059
Actually, the CurrentProject.Path will give only the directory, CurrentProject.FullName will give the path AND the name (A2K).

I guess you'd have to use the code to get the name for an Access97 Db.

BL
 

Users who are viewing this thread

Top Bottom