We help IT Professionals succeed at work.

How do I have linked tables in Access 2007 update to the current location when the app starts after being packaged?

kcfconsulting
on
I have a DB I created with BE linked tables (like I'm supposed to).  I have packaged the application and included the BE database but the location is obviously different when the enduser installes the app so it errors out as soon as the app opens.  I have added
RefreshLinksToPath Application.CurrentProject.Path to the load event but it does not work.   Am I missing something?  How am I supposed to "Package" the application if I don't know where the user will be installing?  Is there a way to set it default to "Current" Location?
Comment
Watch Question

Infotrakker Software
Most Valuable Expert 2012
Top Expert 2014
Commented:
You generally have to include relink code. Basically, you ask the user where the backend is, and then recreate the linked tables. If you're using an installation program (like Inno Setup, for example) then you can write the backend location when the files are installed (perhaps to a registry key, or a text file) and then pickup that value when the app starts and relink.

Here's a good article on using DSNLess connections, which is essentially what you'll do:

http://www.accessmvp.com/djsteele/DSNLessLinks.html