|
-
December 29th, 1999, 03:01 PM
#1
Retrieve Application Path
Hi Gentle folks,
In MSAccess from the menu items I have set the "default directory" as C:\my documents. My database application is in C:\project. In my application I have to write data to a text file which has to be stored in C:\project. "curdir" returns C:\my documents. Is there any other function or method that can be used to retrieve the path of the database application.
Thanx in advance .... Nandini
-
December 29th, 1999, 05:39 PM
#2
Re: Retrieve Application Path
I had a very similar problem a while back. Without going back into my code, I beleive I ended up using CurrentDB.Name
Brewguru99
-
December 30th, 1999, 12:21 AM
#3
Re: Retrieve Application Path
u can use app.path function
-
December 30th, 1999, 10:54 AM
#4
Re: Retrieve Application Path
The project is in MS Access. VB supports app.path, while VBA doesn't support app.path. Any further help on this would be appreciated.
Thanks
Nandini
-
December 31st, 1999, 06:18 AM
#5
Re: Retrieve Application Path
you can use CurDir() function
if you want teh return value as variant type then use this function as it is but if you want to return the value as string type then use $ sign with it
like CurDir$()
This example uses the CurDir function to return the current path.
' In Microsoft Windows:
' Assume current path on C drive is "C:\WINDOWS\SYSTEM".
' Assume current path on D drive is "D:\EXCEL".
' Assume C is the current drive.
Dim MyPath
MyPath = CurDir ' Returns "C:\WINDOWS\SYSTEM".
MyPath = CurDir("C") ' Returns "C:\WINDOWS\SYSTEM".
MyPath = CurDir("D") ' Returns "D:\EXCEL".
' on the Macintosh:
' Drive letters are ignored. Path for current drive is returned.
' Assume current path on HD Drive is "HD:MY FOLDER".
' Assume HD is the current drive. Drive MD also exists on the machine.
Dim MyPath
MyPath = CurDir ' Returns "HD:MY FOLDER".
MyPath = CurDir("HD") ' Returns "HD:MY FOLDER".
MyPath = CurDir("MD") ' Returns "HD:MY FOLDER".
you can check MS Access help for this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|