Understanding Workgroup Information Files

To successfully run the procedures demonstrated in this chapter, you need to know the location of the workgroup information file on your computer. This file, also known as system database (System.mdw), is created automatically when you install Microsoft Office Access 2003 and open a database for the first time. You will find a System.mdw file in the Application Data folder in the user profile in the following path:

C:\Documents and Settings\<user name>\Application Data\Microsoft\ Access\System.mdw

The Application Data folder is a hidden folder. To browse this folder, switch to Microsoft Windows Explorer and choose Tools | Folder Options. In the Folder Options window, click the View tab, click the option button next to Show hidden files and folders, and click OK. Now you should be able to access the above path, where <user name> is the name of your user profile. Take a few minutes right now to locate the System.mdw file on your machine.

Part II

Table 17-1: The workgroup information file in different versions of Access

Access Version

Default Workgroup Information Filename

Workgroup Information File Location









C :\Windows\System



C:\Program Files\Common Files\System



C:\Documents and Settings\<user name>\Application Data\Microsoft\Access

In Microsoft Access 2003, you can also find out the location and name of the workgroup information file using the following methods:

Start Microsoft Access without opening a specific database. Choose Tools | Security, and click the Workgroup Administrator. The dialog box that appears displays the path of your workgroup information file. Start Microsoft Access and open any database. Switch to the Visual Basic Editor window and activate the Immediate window. Type the following statement and press Enter:

? CurrentProject.Connection.Properties("Jet OLEDB:System Database").Value

When you press Enter, Access displays the full path of the workgroup information file that the currently open database uses for its security information. The Jet OLEDB:System Database is a provider-specific property of the Microsoft OLE DB provider for Jet in the ADO Properties collection of the Connection object.

Access uses the workgroup information file to store the following information:

The name of each user and group ■ The list of users who belong to each group

The encrypted logon password for each workgroup user

The Security Identifier (SID) of each user and group in a binary format

Once you add user and group accounts to your database, the workgroup information file will contain vital security information. YOU DON'T WANT TO LOSE THIS INFORMATION. Always take time to make a backup copy of the System.mdw file and store it in a safe location. This way, if the original file gets corrupted, you'll be able to quickly restore your backup file and avoid having to recreate user and group accounts.

The workgroup information file is like any other Access database except that it contains hidden system tables with information regarding user and group accounts and their actual permissions. However, you cannot change the security information by opening this file directly. All the security data stored in hidden system tables is encrypted and protected. Changes to the workgroup information file are done automatically by the Jet Engine when you use the built-in Access commands to manage security or execute ADO/JRO code in your VBA procedures.

Creating and Manipulating Databases with ADO

You can use the same workgroup information file for more than one database or you can create a separate workgroup information file for each database you are securing. You can also give this file a name other than the default Sys-tem.mdw. I find the best way is to use the same name as the database file. For example, if my secured database file is named Assets.mdb, I would create a workgroup information file called Assets.mdw and put it in the same folder as the database file. This way I'd know right away that these two files are associated with one another even after many weeks or months have passed since I created them. Keeping track of which workgroup information file goes with which database can be quite challenging, especially if you are managing more than a couple of secured Access databases.

^^ Note: If you try to open a secured database while another workgroup information file is active, Access displays the following message:

You do not have the necessary permissions to use the <name> object. Have your system administrator or the person who created this object establish the appropriate permissions for you. If you receive the above message while opening an Access database, you should look for the accompanying workgroup information file and perform one of the following:

• Start Access without opening a specific database. Use Tools | Security | Workgroup Administrator and click the Join button. Specify the correct workgroup information file for the database you wish to open. When the Workgroup Administrator has confirmed joining the specified workgroup, start the Access database (see the Access online help on using the Workgroup Administrator Security menu option).

• Set up a shortcut to the database file that uses the /WKGRP command-line switch to load the specified workgroup information file when the database is opened (see Part 3 in Custom Project 17-1).

0 0

Post a comment