Solved

How do I refresh links to a backend database?

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now