Solved

How do I refresh links to a backend database?

Posted on 2014-02-17
5
426 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 39

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 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