Microsoft Access 2010 Bible

(Rick Simeone) #1

Chapter 21: Building Multiuser Applications


765


When using record-level locking, Access locks only the record currently being edited. Record-level
locking is a good option when many users are editing and updating records simultaneously. The
only lock contention that occurs in such a situation happens when two users happen to change the
same record at the same time.

Note
Record-level locking is the default in Access. If you want to use page-level locking, choose File ➪ Access
Options ➪ Advanced to open the Access Options dialog box (shown in Figure 21.7); then deselect the Open
Databases by Using Record-Level Locking check box. In most environments, however, you’ll find that record-
level locking works just fine.


Tip
When you design your applications, the type of database application that you’re creating should drive the locking
strategy that you apply to your applications. Decision support or Executive Information System (EIS)–type appli-
cations usually don’t need any locks (No Locks or Read-Only access), because most users only view data — they
don’t change or add new records to the underlying tables. However, if the records in your application are con-
stantly changing as people add new records or edit existing data, your locking strategy will be more complex.


Access’s built-in record-locking features
Access has several settings available at runtime and design time that you can change to control the
locking behavior of your applications. The Access Options dialog box has an Advanced tab that
contains record-lock settings for your databases (see Figure 21.7). Once set, these become the
default behavior for your database and its objects. You can still change these defaults in code and
in each form you create, though.

FIGURE 21.7

The Advanced tab in the Access Options dialog box

Free download pdf