Reputation: 25272
I wrote a function to relink SQL Server tables in an Access app. That works great, except if I want to change the .connect
property to a server where I have no access. In that case, the tableDef.Refresh
generates an error.
Is there a trick I could use to relink from DEV to PROD before deployment when I have no access to PROD ?
I thought about replacing all linked tables pointing to SQL Server by Passthru queries (select * from tableX
). Any other idea ?
Upvotes: 2
Views: 172
Reputation: 97131
Access will not RefreshLink
a link whose Connect
property points to a data source which is unavailable. That limitation applies not just to server database data sources, but any type of data source.
Create a function you call from an AutoExec macro which checks whether the application is running the first time in the PROD context. And if it is, set the linked tables Connect
properties and call RefreshLink
.
Upvotes: 2