Solved

One frontend for several backends at the same time

Posted on 2014-10-01
3
125 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
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
Comment Utility
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 34

Accepted Solution

by:
PatHartman earned 400 total points
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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…

744 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

15 Experts available now in Live!

Get 1:1 Help Now