Solved

How do I refresh links to a backend database?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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 the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

947 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

20 Experts available now in Live!

Get 1:1 Help Now