Access Cookbook - Ken Getz [204]
Figure 10-4. Setting a password for the Administrator account
The next dialog allows you to add users to any groups you have created. If you have not created any additional groups or administrative users, only the administrator account (in Figure 10-4, this account is named Paul) will be displayed, as shown in Figure 10-5. If you attempt to remove the administrator account from the Admins group, you will receive an error message unless you've created an additional administrator. Access requires there to be at least one member in the Admins group and will not let you delete the last user. Click Next to continue.
Figure 10-5. Adding users to groups
The final dialog prompts you for the name and location of the backup file (see Figure 10-6). The default value is the name of the MDB with a .bak extension. To revert to the unsecured version of your database, just delete the secured MDB after the wizard has completed and rename the extension of the backup file to MDB. Click the Finish button to complete the wizard.
Figure 10-6. Creating a backup file of the secured database
The one-step Security Wizard report is then displayed. This report lists all the security options you've chosen, along with the settings for users, groups, and Personal IDs (PIDs). You should save this and lock it away in a safe place. Should you ever need to recreate your workgroup file, you can use the same settings. Be careful: if your workgroup file is irretrievably lost and you can't restore it from a backup or recreate it, you could be locked out of your database forever. The wizard will save the report in snapshot format.
The wizard then notifies you that the database has been encoded (prior versions of Access refer to this as encrypted) and that you must log onto the secured database using the new workgroup file (see Figure 10-7). This means that the database can't be read by a text editor and can't be compressed by file-compression utilities. If being able to compress the database means more to you than the remote chance that someone will use a text editor to read strings out of the .MDB file, you can decode (decrypt) the database using Tools → Security → Encode/Decode Database....
Figure 10-7. The wizard notifies you that the database has been encoded
Work with the secured database
Once the Security Wizard has finished, you need to shut down Access and restart. The Security Wizard creates a shortcut that automatically connects you to the newly secured database. Figure 10-8 shows the property settings of the shortcut. Note that the Target includes the /wrkgrp switch that points to the new workgroup file.
Figure 10-8. The property settings of the database shortcut
Follow these steps to manually create your users and groups according to the security model you've planned:
Double-click the shortcut on your desktop to open the newly secured database. Login as the administrator account you created when running the wizard (the one with the same name as your Windows login). Select Tools → Security → User and Group Accounts from the menu. This will load the User and Group dialog. Create the groups shown in Table 10-1 by clicking the Groups tab and then the New button. When you create a new group account, you will be asked to enter a Name and a Personal ID (PID). For each group account, enter the name of the group account under Name and a case-sensitive alphanumeric string between 4 and 20 characters long under Personal ID (see Figure 10-9).
Figure 10-9. Creating custom groups and users
Create the users. Click the Users tab and the New button to create each new user. The PID that you enter is not the password—you'll need to log on as each user to set an initial password for that user. Add each user to his or her groups, as listed in Table 10-1. By default, new users will be members of the built-in Users group; do not remove users from this group.
Assign permissions to the database objects. You will now take the object inventory in Table 10-2 and add