Microsoft Access Linked tables Dialog Box if Database Move to Another Location (1 Viewer)

Mohsin Malik

Registered User.
Local time
Tomorrow, 03:16
Joined
Mar 25, 2012
Messages
175
Hello All,

I have a question that I have a Microsoft Access database (.accdb) front-end/backend split and I want to give the database to my company client. As we have the different path for the backend/frontend linked. I want some code that will popup if the database location is not found and popup with the dialog so the user then select the backend and it would be ready and there is no need to popup each time the database open, it would run once it did not find the last linked path.

Also I have tried the code of Dev Ashishhttp://access.mvps.org/access/tables/tbl0009.htm but unfortunately it would ask everytime to refresh the table links and I only want to run the process of linking tables when the database start and the linked path not found, I hope if anyone can help me quick.

Thank you
Mohsin
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 23:16
Joined
Sep 12, 2006
Messages
15,614
normally, relinking is based on checking the connected backend for a table

the DAO syntax is

currentdb.tabledefs("sometable").connect

the connect string for a connected table will look like this
;database="full path spec"

if "full spec path" is correct for the new backend, then you do not need to do anything. If it is incorrect, then the tables are not linked.

I use code to drop all the existing tables and reconnect them to the new back end. My databases hold a local table of the tables that require reconnecting (You may be able to change the connection string dynamically, and "repair" the connection, but I don't do it that way.)

There are a number of examples of this on the forum. Search for "relink" in the code samples
 

Users who are viewing this thread

Top Bottom