Setting path to location of current mdb file 
Author Message
 Setting path to location of current mdb file

I am developing a database application and will be providing a backup
capability.  I want to make the location of the backup the same as the
location of the existing database.  I have searched help but have been
unable to find out how to do this.  In VB you can use

ChDrive App.Path
ChDir App.Path

Any suggestions?
--
Jon Dubke



Sat, 05 May 2001 03:00:00 GMT  
 Setting path to location of current mdb file
On Tue, 17 Nov 1998 07:40:17 -0800, "Jon Dubke"

Quote:

>I want to make the location of the backup the same as the
>location of the existing database.

If you check the value of

  CurrentDB.Name

you can then use instr() or right$() to chop off the file name to
leave the path.

HTH
Tim F

--



Sat, 05 May 2001 03:00:00 GMT  
 Setting path to location of current mdb file
Currentdb.Name gives you the full path to the database, so all you need to
do is parse the path from that.

e.g.

'Posted originally by Ken Getz
Function CurrentDbDir() As String
  Dim strPath As String
  strPath = CurrentDb.name
  CurrentDbDir = Left(strPath, Len(strPath) - Len(Dir(strPath)))
End Function


Quote:
>I am developing a database application and will be providing a backup
>capability.  I want to make the location of the backup the same as the
>location of the existing database.  I have searched help but have been
>unable to find out how to do this.  In VB you can use

>ChDrive App.Path
>ChDir App.Path

>Any suggestions?
>--
>Jon Dubke



Sun, 06 May 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Crystal Reports 6 and Setting MDB File Name and Location

2. Crystal Reports 6 and Setting MDB File Name and Location

3. Crystal Reports 6 and Setting MDB File Name and Location

4. Crystal Reports 6 and Setting MDB File Name and Location

5. Setting the path to the path of the current application

6. How to set path for database (.mdb) file ???

7. get path of current mdb in code

8. Get current mdb path from with in Access97

9. Set database location path problem (OCX) (C++)

10. How do I set path current from dir1 and drive1 objects

11. Problem using GetPrivateProfile to set current path

12. enumerate location of .mdb file

 

 
Powered by phpBB® Forum Software