news.dsl.pipex. com wrote:
Hi
I have a front/back end scenario for my access app. I need to allow
user to connect the front end to one of two back ends at start time.
Presumably this needs linking to the relevant back end using vba
code. How is this achieved?
Thanks
Regards
Many people use code that does the following:
For each table...
-attempt to open the table in code
-when the first table fails to open relink all tables (look in current
folder or a stored folder name, else prompt user for location)
I've found attempting to open each table to see if it opens can be a
little slow over a network. Instead I do the following to test the
links:
For each tabledef...
-get the file/folder name in from the link property
-test that the file/folder exists
-if the data file exists test that the tabledef exists in that database
-when the first test fails relink all tables (look in current folder or
a stored folder name, else prompt user for location)
You can be smarter and just relink the tables that failed but I haven't
found it worth the effort:)
Also, instead of relinking the tables you can also look at just deleting
the tabledefs and creating new ones...
ps. If you need a sample of code to relink let me know... I've got a
simplified version I wrote to attach to different data files (so my
Access app acts like Word in that you have to open a "doc" which in this
case is a seperate data file)
--
regards,
Bradley