By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

Relink Queries From Old Server to New Server

P: 1
Fellow experts,

I have a Access file which is outdated. My task is to relink the Access file to another Access file. The problem is I don't know how to relink them, tried this (https://support.office.com/en-us/article/Import-or-link-to-data-in-another-Access-database-095ab408-89c7-45b3-aac2-58036e45fcf6) but still not working. The error said Could not find file 'myOldServerFile.accdb', I want change that myOldServerFile.accdb to myNewServerFile.accdb. Please help me
Aug 15 '17 #1

✓ answered by NeoPa

The general approach is to cycle through the TableDefs (CurrentDb().TableDefs) ignoring those where the .Connect property is not a match for what you want to work on. For those that need to be changed set the property to match what it was before except for the name of the database that it points to. Once this has been done you can call the TableDef method .RefreshLink(). If all's been done correctly this will point the table to the new database. Once the cycle's been completed your whole database now points to the new database rather than the old one.

Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,411
The general approach is to cycle through the TableDefs (CurrentDb().TableDefs) ignoring those where the .Connect property is not a match for what you want to work on. For those that need to be changed set the property to match what it was before except for the name of the database that it points to. Once this has been done you can call the TableDef method .RefreshLink(). If all's been done correctly this will point the table to the new database. Once the cycle's been completed your whole database now points to the new database rather than the old one.
Aug 19 '17 #2

Post your reply

Sign in to post your reply or Sign up for a free account.