Solved

How do I refresh links to a backend database?

Posted on 2014-02-17
5
431 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 58
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 58

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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.
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…

729 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