?
Solved

One frontend for several backends at the same time

Posted on 2014-10-01
3
Medium Priority
?
135 Views
Last Modified: 2014-10-02
I have a split database with a frontend (FE.mdb) and several backend databases (one for each year: 2014.mdb, 2013.mdb, 2012.mdb, etc).
The problem arises when the user wants to have more than one year open at the same time (mainly by the turn of the year, when you have to work with data from the new year and data
from the previous year).
What happens is that if you are working with one year (2014.mdb) and you open another year (2013.mdb), the instance where you were working with the 2014.mdb data gets linked to 2013.mdb (specially the tables you hadn't open yet).
What I am doing is to open two instances of Access, each with the frontend database (FE.mdb), but the first one linked to 2014.mdb and the second one to 2013.mdb. However when you link the second one (2013.mdb) the first one (2014.mdb) gets also linked to the same bakend (2013.mdb).

Can anyone help me solve this problem?
0
Comment
Question by:soft7
[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
3 Comments
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 400 total points
ID: 40355310
You can have multiple backend databases linked in the same frontend, but I don't think you can do it if the tables are named the same.

A better solution - don't store your data like this. Access isn't Excel, and you shouldn't store your data like it's in Excel. Instead, store ALL of your data in a single database, and then query those tables to get the right datasets - if you need 2013 data, then query your tables for all Dates in the 2013 year, and so on.

If you need to archive data - which is data that is set in stone (so to speak) and will never change, then it's okay to flatten out your tables and move that historical data to other databases - but you would rarely, if ever, need to join that archived data to the new data.
0
 
LVL 38

Accepted Solution

by:
PatHartman earned 1600 total points
ID: 40355469
I don't want to beat up on you but I'm with Scott.

The reason you can't do what you are attempting to do with a single FE is quite logical once you think about it.  Even though when you open a database, some of it gets loaded into memory but not all of it (a database is not a spreadsheet or word document - it is a collection object which is quite different logically), things that change get saved back to disk.  Therefore, when you relink the tables, you are changing something and it gets saved back to disk.  The connection string to a remote table is saved in the MSysObjects table and that is in the FE.  When you relink the tables, MSysObjects is updated so that the next time you open a table, it has the correct connection string.  It appears from what you indicated that the relink doesn't affect tables already open in the other database but that would be because the connection string has already been loaded into memory and Access doesn't need to retrieve it from disk each time the table is accessed.  But for tables that were not open at the time, Access has to go to the MSysObjects table which is now different than it was when the other tables were opened.

I hate to even offer the solution because what you are doing is so not Access but I will.  Copy the FE and name it MyFE_LastYear.  Leave the current database linked to the current BE.  Link the copy of the FE to last year's tables.  That way, if the user needs to have both years open, he can open the "production" database to see the current data and he can open the "last year" database to see last year's data.

Hopefully, you will take the expert advice to heart and start working on changing the database so that you don't create separate files for each year.  It will be a fair amount of work at this point because changes of this nature are always difficult whereas designing the app correctly from the beginning would have required little to no additional effort.  As it is you'll have to change many queries to select a specific year's data.  Of course anything that is already based on a date range can stay.
0
 

Author Closing Comment

by:soft7
ID: 40357725
You two are right, but Pat's answer is more complete and besides it offers me a very good and easy solution that works. So I am spliting the points but I'll give some more to Pat.
Thank you two for your answers.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

764 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