| Title: | MSACCESS |
| Moderator: | BUMP::HONER |
| Created: | Tue Dec 01 1992 |
| Last Modified: | Mon Jun 02 1997 |
| Last Successful Update: | Fri Jun 06 1997 |
| Number of topics: | 1661 |
| Total number of notes: | 6339 |
I'm struggling with the CURDIR$ function in MS-Access. I open the database in a
specific directory and try to find the path, where I've started it. In Visual
Basic there is a function called APP.PATH, which provides you with the right
path.
For example I have a test.mdb in a directory C:\TESTING
I also have another file in the same path located, I want to access. Nearby
every time I try to find my current path with CURDIR$ the result is
C:\My Documents
From where does that come? And how can I find the right path, where I'm really.
Is that a bug or a feature of CURDIR.
APP.PATH(VB) is not known in Access, or in other words I'm not so familiar with
API calls, that I can build that function in Access.
Can somebody help?
| T.R | Title | User | Personal Name | Date | Lines |
|---|---|---|---|---|---|
| 1632.1 | NETRIX::"[email protected]" | Fasoli | Wed Mar 05 1997 10:15 | 19 | |
The NAME property of the current database object returns the full path
of the current db:
Dim PathName as string, db as database
'Set db to the current db
Set db = DBEngine.Workspaces(0)(0)
PathName = db.Name
Debug.Print PathName
This code would return something like: c:\access\MyDatabase.mdb
You could parse this string using Left$, Right$, Mid$, etc. to
give you parent directory, etc.
It's not an 'elegant' solution, but it works!
[Posted by WWW Notes gateway]
| |||||