I have a question that I had trouble putting an appropriate title for. I need to distrubute a front end to multiple locations within our WAN. The back-end tables will be located on a specific drive that everyone has access to.
The problem I ran into is that not everyone has the drive that contains the backend mapped to the same drive letter. It appears that Access refers to the location of the backend by the Path ( ie H:\tables\backend) rather than the server name (wvadrive1\tables\backend).
I know that I can refer to the server name instead of drive name via VB code, but when setting up the linked tables via Linked Table Manager / External data, it appears access maps it based on drive letter.
Is there an easy solution to ensure that everyone I distrubute this to will have their tables properly linked? Can I run some VBA the first time the database is opened to map the linked tables?
Thanks!
Use VBA to change the
TableDef.Connectproperties to point to the file share (UNC path) instead of drive letter.In the simplest case, all your users can use the same UNC path, and all of the linked tables are in the same db file …
Do that on the db file before you distribute it to the users. If you wanted, you could run a similar procedure afterward from the users’ local copies of the db file.
Note that code will change only the links to Access tables. Links to other data sources (ODBC, Excel, text files, etc.) will be ignored.
If you need to link to tables in more than one Access backend db, use a separate table which includes the db path and table/link name. You can then open that table as a recordset and loop through it to change/create your links as needed.