Solved

One frontend for several backends at the same time

Posted on 2014-10-01
3
134 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 100 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 37

Accepted Solution

by:
PatHartman earned 400 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

691 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