Solved

One frontend for several backends at the same time

Posted on 2014-10-01
3
131 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 84

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 36

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

749 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