Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Struggling to update linked tables location in Access 2007 using ADO

Status
Not open for further replies.

4N6Mstr

Technical User
Oct 6, 2008
40
US
Hello all,

I have a single user db in MS Access - split – front end and back end both 2007 accdb - installation using the Access packaging runtime, back end (and the subfolder where it "sits") added as a "extra" file during packaging, as per Microsoft instructions.

I will be sending this to different users and they will choose an installation location, the front end will be located in a (main) folder in that location, the back end in a subfolder inside that main folder.

I did a lot of "surfing", found a bunch of different solutions, many of them DAO (which I would prefer not to use, as everything else is ADO) and others that still do not work for one reason or another.

Anyway, to me it seems that all should come down to traversing the tables inside the CurrentDb and identifying the linked tables, for which CurrentDB.TableDefs(“current table number”).Connect has the current link info. After that, it should be just a matter of assigning the new path to .Connect and use .RefreshLink to update the info.

Alas that does not work. I do not receive an error message; however, the link (.Connect info) is not updated. I tried using variables instead of directly using the CurrendDB, but that did not work either.

Am I going completely wrong about this? Do I have to delete / recreate the linked tables? Or…

Do any of you have a good code for this? In principle, I am looking for the down and dirty code, to address just the update of the links, as this is a limited number of users and I can control many of the variables in regards to the installation. Naturally, if what you have is the catch all code (the one that checks if the DB and tables exist, tests the different types of tables, offers the File Lookup window if the provided link is not correct, etc.), I will not complain. :)

Any help is always apreciated!

Thx,


4N6MSTR
______________________________________________
If you don't know where you are going
It does not matter how fast you are
You will never get there
 
I found the solution for my quest:


It works really well for what I need (runtime installation, front-end installed in a "user-chosen" folder, back-end inside a subfolder), although it is not a "for-any-situation" type of solution.



Any help is always apreciated!

Thx,


4N6MSTR
______________________________________________
If you don't know where you are going
It does not matter how fast you are
You will never get there
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top