Microsoft Access 2010 Bible

(Rick Simeone) #1

Part III: More-Advanced Access Techniques


766


Default Open Mode
The Default Open Mode setting in the Advanced tab of the Access Options dialog box should always
be set to Shared in multiuser applications (Shared is the default). After all, if everyone tried to open
the application in Exclusive mode, no two users could use the database at the same time. You may
use the Exclusive mode as the administrator to update files and tables, add forms, and so on.

Default Record Locking
Default Record Locking controls whether or how Access handles locking when your users add,
edit, or change records within a recordset. Once set, the Default Record Locking setting applies
globally to the objects you create within your database.

Note
The same settings exist within the Design view of forms, which will override the Default Record Locking set-
tings of the Advanced tab.


Here are your Default Record Locking options:

l (^) No Locks: This setting allows you or your users to add or edit a record without locking
the page in which it exists. The only locking occurs during the split second when the
update is actually written to the Access table. Thus, when No Locks is set, someone might
be able to start an edit but might not be able to finish it. The No Locks setting is most
appropriate in environments where users will be adding many records simultaneously.
This setting allows all adds to be started and almost all updates to be committed (unless
two people save the record at the same time). Your error-handling routines must antici-
pate the errors that occur when the record is committed. The No Locks setting is called
optimistic locking because you have every expectation that the record commit will proceed
without error.
l (^) All Records: The All Records setting locks an entire recordset as long as the user has the
table, form, or query open for viewing. This setting really has no practical use in a
dynamic multiuser environment. The only time it should be used is when you’re doing
some kind of administrative updates to a table and don’t want anyone else editing records
while you’re updating.
l Edited Record: Also called pessimistic locking, this setting locks a record when a user tries
to obtain a record for editing. Access locks the record (or page) at the moment a user
begins editing a record (as opposed to No Locks, which locks the page only at the instant
the record is committed to the database). Pessimistic locking is appropriate in applications
where data will be changed frequently but not added. In these environments, you don’t
want two users trying to edit the same record at the same time — if they do, one user has
the potential to overwrite the changes of the other. With Edited Record locking on, your
application can capture an error when the second user tries to obtain the lock for editing;
the application then notifies the user to wait until the other user is finished.

Free download pdf