set path at startup?

D

Daniel Attard

I am a newbie, so hopefully someone can be patient with
me and help me to fix my problem.

I use an Access2002 database that has been split: the
front-end is on my machine, and the back-end data is also
on my machine, in a MSSQL directory. The tables are
linked using a network path (\\Daniel\Data\xxx.mdb)
rather than a path through the C drive (C:\Program
Files\Microsoft SQL Server\xxx.mdb). The reason the
tables are linked this way is so that the other user on
my network can use the same front-end to access the
data.

The problem I am having is that sometimes I work on the
database at the office (in a networked environment) and
sometimes at home (in a stand-alone environment). There
are a variety of macros and procedures that check for the
existence of files in specified directories, but these do
not work when I am in a stand-alone environment, meaning
that I cannot fully work with the database unless I am
connected to the network.

Is there some way that the program can check to see
whether it is operating on the network, or stand-alone,
and then set the path accordingly? Once the path has
been set once, I would like all macros and procedures to
use the path that has been set, rather than presently
where the path is static to either a network share or
stand-alone.

I hope this makes sense. Thank you in advance for your
assistance.
 
B

Bruce M. Thompson

Is there some way that the program can check to see
whether it is operating on the network, or stand-alone,
and then set the path accordingly? Once the path has
been set once, I would like all macros and procedures to
use the path that has been set, rather than presently
where the path is static to either a network share or
stand-alone.

See the following page at The Access Web for some code that you might find
useful:

Tables: Relink Access tables from code
http://www.mvps.org/access/tables/tbl0009.htm

If you have problems with implementing this, post back for more help.
 

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