Solved

How do I refresh links to a backend database?

Posted on 2014-02-17
5
428 Views
Last Modified: 2014-02-22
As part of my application (front end) Restore routine, I have deleted the (old) data file and replaced it with the backup data file.

The application has a table of table names which I can reiterate through to link to.  How do I link to the tables in the back end?

Thanks in advance.
0
Comment
Question by:CRB1609
  • 2
  • 2
5 Comments
 
LVL 40

Expert Comment

by:als315
ID: 39864448
You can use free JStreet Acccess Relinker.
Version with support of x64 systems you can find here:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_27945777.html
0
 
LVL 57
ID: 39864618
Just to add a little bit, "relinking" is the process of updating a tabledefs Connect property.

The connect property contains a string that tell Access/JET how to connect to a data source.

The built-in Linked Table Manager, the linker mentioned above, and all the others out there work with this string.

When re-linking, there are two basic approaches:

1. Refresh the links already in the DB - This relies on what's already there.

2. Using a local table, which has a list of the tables, delete and re-create the links.

The second is a little better for a number of reasons, but depending on the DB, required certain permissions.   That's not the problem it once was since from A2007 up, Access workgroup based security is used anymore.

In either case, one usually puts up a open file dialog to ask the user where the BE database is and doesn't let them start the app until all BE's are located.

 I've got re-linking code that does it both if you want to see how it's done.

Jim.
0
 

Author Comment

by:CRB1609
ID: 39866348
Jim,

I am trying to use your method 2.  I use the open file dialog to locate the BE and I don't let them start before all tables are re-linked.  Unfortunately, I can't get the re-linking routine to work.

I would really appreciate your code to see how it's done.

Regards, Clive
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 39868203
Clive,

  Attached is a sample DB showing various linking strategies.  Look at the refresh vs reattach routines.

 Also note this is ancient code, so there are some things that could be done differently (ie. calling the open file dialog for example).  

 But in regards to the refresh/relinking part, that is unchanged even today and you'd still do it the same way.

Jim.
Relink2.Zip
0
 

Author Closing Comment

by:CRB1609
ID: 39880179
Thanks, Jim.  Very helpful.

Clive
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question