PowerUser
PowerUser

Reputation: 11791

In Access 2003, how to link to a table in the current folder

I'm adding features to a multi-user Access db.

  1. Because it's multi-user, I've split it up into a Backend (with all the tables & queries) and a Frontend (which links to the Backend).
  2. And because it's still in development, both files are on my local machine.
  3. And currently, When I deploy it onto the shared drive, I have to rebuild all the links between these 2 files.

Is there a more 'elegant' way to do this than rebuild the links every single time I copy these files over? i.e. in the Linked Table Manager, instead of the links looking like "C:\Reports\Backend.mdb", can I change it to something like "%CurrentFolder%\Backend.mdb"?

At first glance, it sounds like an infrequent annoyance, but earlier today I copied the files from the shared drive to my local machine to do some new development. An hour later, I realized the Frontend on my local machine (i.e. the Test environment) was still linked to the Backend on the Shared drive (i.e. Production). So, in other words, I've been writing test data to the Production version of this report.

Upvotes: 1

Views: 1155

Answers (1)

Albert D. Kallal
Albert D. Kallal

Reputation: 49309

I assume that you cobbled together some type of relink code on startup? (quite much everyone has to do this). So, your startup code can check the path of the current link, and if it not correct, then simply run your relinking code and you pass the relink code the currentproject.path + back end file name. So, currentproject.path will return the current path of the database.

In effect, you cannot supply or use a relative link. However, the above process essentially gets you the same effect since your code will relink if you move or rename the folder where the FE + BE are.

Upvotes: 1

Related Questions