refering to a file

  • Thread starter Thread starter Audrey
  • Start date Start date
A

Audrey

Hi,

I'm trying to refer to a file name from my database to
open an external file.

Right now, I have to enter the full path
(C:\folder\filename.ext)

Both files will be in the same folder, but I don't know
what folder they will be placed in later on, and they
might be moved a few times.

Is there a way to find from code the current path of a
database and use this path to concatenate to the filename
of the external file?

Thanks for the help.
 
Yes, I would also like this question answered.. I tried to
refer to "\images\filename," since the images directory is
in the same directory as the database. But this doesn't
work .. and ".\" is no help either.

Thanks to anyone who has an answer for this,
Gurtz
[email = no $]
 
shucks...

I'm stuck with 97 :-( And I'm not good enough to hard-code
the thing.

Thanks for the tip though.
 
Audrey said:
shucks...

I'm stuck with 97 :-( And I'm not good enough to hard-code
the thing.

Oh, you can get it with Access 97. It's just a bit more complicated.
Here's what you do:

Dim strDBFolder As String

strDBFolder = CurrentDb.Name
strDBFolder = Left(strDBFolder, Len(strDBFolder) -
Len(Dir(strDBFolder)))

That gives you the folder path *with* the trailing backslash, unlike
CurrentProject.Path.
 
Back
Top