Setting relative references

  • Thread starter Thread starter Jim Shaw
  • Start date Start date
J

Jim Shaw

BlankHow can I set a relative reference to another database? In
vba>tools>references, I'm forced into an explicit, full path reference to a
supporting database that is located in the same folder as my application.
What I want is to use the ".\Db1.mdb" (dot-slash) file specification form.
I know! Its an old DOS/UNIX technique, but I've been in away from
programming too long to know what the current paradigm is for this. 8-)

Background:
I have a split database called HR.mdb and HR_be.mdb. I also have a
referenced database named EL.mdb that provides error logging services to
HR.mdb. These databases were developed on drive "D:\...\" on my
development system.

I wish to deploy my application to my client's machine in "mde" format and
it needs to be installed on their "U"\...\" drive with a different folder
chain. However all three databases will still be in one folder with each
other.

Problem:
When I fire up HR.mde, I get broken reference messages to EL.mde and broken
links to HR_be.mde. When I go into HR.mde's VBA/IDE, the references menu
option is grayed out. So I can't fix the problem.
I hope I don't have to deploy *.mdb versions and then make *.mde versions on
the client machine.

How do you professionals handle this?

Thanks
Jim Shaw
 
Jim,

If it will *always* be the way you describe on the client's computer,
you would be able to get away with temporarily remapping your D: drive
as U: while you link the tables and prepare the files for
distribution. I have done this type of thing often.

Otherwise, you need code in your database that checks the links when
the database is opened, and if it doesn't find the linked tables in
the expected location, prompts the user to locate the backend files.
For this, I use code adapted from
http://www.mvps.org/access/tables/tbl0009.htm

- Steve Schapel, Microsoft Access MVP
 
Steve.
I've been looking at your ms.access web page. Good stuff there.

I already have the code you suggest in my application for relinking tables
to the back end. That works real good. My problem is that I don't get to
it because of the broken reference to the EL.mde file.

I'll try the remapping of the drive and that will work in this specific
case. However, if the client likes this prototype application, I'll have to
roll it out to 200+ additional sites and directory locations. I'm not sure
the developer's packaging wizard will be of much help with this either.
Microsoft must have a way to deal with this. I'm beginning to think about
merging the EL.mde logic in to HR.mde and eliminate the need for a
reference. It goes against my grain to do that, but in business we must
make compromises with the purist view...

Anyhow, thanks for getting me off the dime and moving again.
And Thanks for your web page.
-Jim Shaw
 
Jim,

Apologies that my earlier reply was incomplete, and told you stuff you
already know. Here is some more info you might find relevant...
http://www.trigeminal.com/usenet/usenet026.asp?1033

By the way, if your complimentary comments about The Access Web were
directed at me personally, they are misplaced. I can claim no credit
for this fantastic resource. Dev Ashish has done most of the work,
with a lot of help from various people, especially Arvin Meyer.

- Steve Schapel, Microsoft Access MVP
 
Apologies not needed nor expected.
You have given me a lot of info to absorb and opened a new world view of
access for me.
Going to curl up by the fire and study this stuff. Its right on target.

My comments of the web site was related to a page that you referenced in a
response to another message here. Thought I saved it in my favorites, but I
can's seem to find it nor the message it was in. It definitely was not the
Access Web. The site talked about not having a place to put the information
so you put it there. Had some nice articles on the page.

Well thanks for the help. I got what I asked for. Hope I can return the
favor somehow.
-Jim Shaw
 
Back
Top