Understanding Access's Locking Mechanisms
Although the preceding tips for designing network applications reduce network traffic, they in no way reduce locking conflicts. To protect shared data, Access locks either a record or a page of data as the user edits a record. In this way, multiple users can read the data, but only one user can make changes to it. Data can be locked through a form or through a recordset that isn't bound to a form.Here are the methods of locking for an Access application:
- Record locking
- Page locking
- Table and Recordset locking
- Opening an entire database with Exclusive Access
With Record locking, Jet locks only the record the user is editing. With Page locking, Jet locks the 4K page with the record being edited. On the other hand, in Table and Recordset locking, Jet locks the entire table or recordset with the record being edited. With Database locking, Jet locks the entire database, unless the user opening the database has opened it for read-only access. In that case, other users can also open the database for read-only access. You can restrict the ability to get exclusive use of a database through security.It's important to note that the locking scheme you adhere to depends on the source providing the data. If you're using client/server data, you inherit the locking scheme of the particular back end you're using. If you're manipulating Indexed Sequential Access Method (ISAM) data over a network, you get the type of data locking that the particular ISAM database supports. For example, if you're working with a FoxPro database, you can use Record locking or any other locking scheme that FoxPro supports.NOTEMultiuser development and multiuser issues are covered in extensive detail in Alison Balter's Mastering Access 2002 Enterprise Development .