Split your MDB file into data and application

        3 votes: *****     5,611 views      No comments
by Allen Browne, 20 April 2005    (for ALL VERSIONS of Access)

Microsoft Access Tips for Serious Users

Provided by Allen Browne.  Created: 1994.  Last updated: September 2008


Split your Access database into data and application

Even if all your data is in Access itself, consider using linked tables. Store all the data tables in one MDB or ACCDB file - the data file - and the remaining objects (queries, forms, reports, macros, and modules) in a second MDB - the application file. In multi-user situations, each user receives a local copy of the application file, linked to the tables in the single remote data file.

Why split?

There are significant advantages to splitting your application:

  • Maintenance: To update the program, just replace the application file. Since the data is in a separate file, no data is overwritten.
  • Network Traffic: Loading the entire application (forms, controls, code, etc) across the network increases traffic making your interface slower.

Access includes an Add-In to perform the split:

Access 95 - 97 Tools | Add-Ins | Database Splitter
Access 2000 - 2003 Tools | Database Utilities | Database Splitter
Access 2007 Database Tools | Move Data | Access Back-End

In some cases you will link additional files:

  • Static look-up data such as postal codes might be kept in its own file.
  • Linked temporary tables might avoid the need to compact the application file.

Is the Data present?

Once split, the data may be unavailable to the application. This happens if the network is down, the data file is moved, or folder/network names are altered.

For a single-user set-up where the application and data files are in the same folder, see Peter Vukovic's tip:
    Attached tables: reconnect on start up

If the files are in different folders (e.g. across a network), see Dev Ashish's article:
    Relink Access tables from code

Sep 2008 update: Armen Stein has released a relinker that supports linking to multiple back ends:
    J Street Access Relinker

Consider attaching a uniquely named table and testing the link on this table to ensure the user cannot link the wrong mdb.

In Access 2002, you can display a FileOpen window with the FileDialog object, if you include a reference to the Microsoft Office 10.0 Object Library. This object does not work with the Run Time version, and was not available in earlier versions, but Solutions.mdb (a sample database distributed with Access 97) contains a module with the API code to display the Windows FileOpen dialog. Alternatively, see Ken Getz code in this article:
    API: Call the standard Windows File Open/Save dialog box

For further reading, see:


Home Index of tips Top

Rate this article:  Your rating: PoorYour rating: Not so goodYour rating: AverageYour rating: GoodYour rating: Excellent


This is a cached tutorial, reproduced with permission.

Have your say - comment on this article.

What did you think of 'Split your MDB file into data and application'?

No comments yet.

Why not be the first to comment on this article?!

Have your say...

Name
E-mail (e-mail address will be kept private)
Comments


Comments require approval before being displayed on this page (allow 24 hours).