Absolute v Relative Path Help...

K

KLZA

Hi. I have an Access DB that resides on a network drive. Not
everyone in my company maps the network drive the same. Anyone can
map it with any letter (ie - drive H: M: etc). The database looks
for
a text file in the same root directory where the DB resides to email
it. Since anyone can map there drive letter, i need a relative path
to the text file. Is it possible to have the access DB look for the
text file using a relative, rather than absolute path?

It currently works for anyone mapped as H. See below..


BodyFile$ = ("H:\Customer Service\CiRT\CIRCUIT REQUESTS ETC
\emailbody.txt")


I need it something like this:
BodyFile$ = (".\emailbody.txt") or BodyFile$ = ("emailbody.txt")


I tried CurDir$ and App.Path but I'm not getting anywhere...
 
J

Jeff Boyce

Already responded to in another newsgroup.

It's seldom necessary to post to more than one newsgroup. In this instance,
I don't see how this "macros" newsgroup is relevant.

If your situation requires posting to more than one, add the relevant
'groups in the "To:" (Newsgroups:) section. That way, the server treats it
as a single post, and an answer in one 'group shows up in all. Easier for
you to find any answers, and easier on the answerers (because they don't
duplicate their efforts).

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
T

Tom Lake

KLZA said:
Hi. I have an Access DB that resides on a network drive. Not
everyone in my company maps the network drive the same. Anyone can
map it with any letter (ie - drive H: M: etc). The database looks
for
a text file in the same root directory where the DB resides to email
it. Since anyone can map there drive letter, i need a relative path
to the text file. Is it possible to have the access DB look for the
text file using a relative, rather than absolute path?

It currently works for anyone mapped as H. See below..


BodyFile$ = ("H:\Customer Service\CiRT\CIRCUIT REQUESTS ETC
\emailbody.txt")

How about using the server name rather than a mapped drive letter?

BodyFile$ = ("\\yourservername\Customer Service\CiRT\CIRCUIT REQUESTS
ETC\emailbody.txt")

Then everyone can use it with no change.

Tom Lake
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top