I have been having issues dealing with "moving servers" addresses, file relocations, and folder name changes.
this makes 'linking' quite difficult.
I came up with this option, and am wondering if this would work.
Basically, this code deletes your current link, then recreates it based upon the path of the current database location. As long as the two databases are relativily equal in there locations, one could move the databases / be in completely different locations, and the links would always work fine.
IE:
One computer has the location as w:\database folder
Another has q:\somewhere\somehow\I\don't\get\it\database folder
3rd example \\serverWierd\someplacehot\cool\cheese.blue.org\database folder
and the links would still be established correctly.
In fact, old broken links would be erased and re-established correctly.
I KNOW there are limitations to this.
For example... If this is run from A FRONT END, then the front end's current location is give as the current location.
Can anyone think of a way around this? Without user interaction?
The only option I can think of for this example would be to allow a user to manually run this "relinking" process by re-copying out a new user interface from the backend setup.
IE:
If the current front end fails, tell user to go to backend location, open the "backup" user interface, on doing so, the links are re-established and a copy of the front end is put on user Computer with desktop link.
Don't really like that option though... too.. clumsy and dependent on user knowledge / skill.
Any other ideas guys?
Kelemit
this makes 'linking' quite difficult.
I came up with this option, and am wondering if this would work.
Code:
'Delete old table connection
DoCmd.DeleteObject acTable, "ExampleTableLink"
'remake them based on current location.
DoCmd.TransferDatabase acLink, "Microsoft Access", Application.CurrentProject.Path & "\DatabaseName.mdb", acTable, "ExampleTable", "ExampleTable"
Basically, this code deletes your current link, then recreates it based upon the path of the current database location. As long as the two databases are relativily equal in there locations, one could move the databases / be in completely different locations, and the links would always work fine.
IE:
One computer has the location as w:\database folder
Another has q:\somewhere\somehow\I\don't\get\it\database folder
3rd example \\serverWierd\someplacehot\cool\cheese.blue.org\database folder
and the links would still be established correctly.
In fact, old broken links would be erased and re-established correctly.
I KNOW there are limitations to this.
For example... If this is run from A FRONT END, then the front end's current location is give as the current location.
Can anyone think of a way around this? Without user interaction?
The only option I can think of for this example would be to allow a user to manually run this "relinking" process by re-copying out a new user interface from the backend setup.
IE:
If the current front end fails, tell user to go to backend location, open the "backup" user interface, on doing so, the links are re-established and a copy of the front end is put on user Computer with desktop link.
Don't really like that option though... too.. clumsy and dependent on user knowledge / skill.
Any other ideas guys?
Kelemit