Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
PRB: Jet 4.0 Row-Level Locking Is Not Available with DAO 3.60
Article ID: 306435 - View products that this article applies to.
This article was previously published under Q306435
According to Microsoft Knowledge Base article 275561
(http://support.microsoft.com/kb/275561/EN-US/ )"ACC2000: New Features in Microsoft Jet 4.0":
To minimize the impact of the increased page size and respond to a long-standing request from developers building applications based on the Microsoft Jet database engine, row-level locking was added to Jet 4.0.However, row-level locking of an Access database is not available with Data Access Objects (DAO) 3.60.
To resolve this problem, use ActiveX Data Objects (ADO) to enable row-level locking on an Access database, and then open DAO connections to the database. All subsequent attempts to open DAO connections to the database will respect the locking mode that you set.
This behavior is by design. DAO 3.60 was not updated to incorporate this Microsoft Jet 4.0 functionality.
The first user to open an Access database determines which mode is used while the database is open. Thus, if the first user uses row-level locking to open the database, users that subsequently open the database will use row-level locking.
When you use the Microsoft OLE DB Provider for Jet 4.0, you can configure row-level locking from within ADO. To enable row-level locking by using ADO, select the Jet 4 Provider, and then set the Connection object's dynamic Jet OLEDB:Database Locking Mode property to 1.
To enforce DAO to use the row-level locking that ADO sets, follow these steps:
Sample CodeThe code sample to follow demonstrates the sequence of statements to configure row-level locking by using ADO and then opens a DAO connection to the database by using row-level locking. In this sample, the DAO database is declared at Form level so that all DAO databases that are opened within the Form use row-level locking. In addition, this sample uses the Access 2000 Northwind.mdb sample database, which is copied to a folder named C:\MDB.
For more information, see the following MSDN Web sites:
Page-Level Locking vs. Record-Level Locking
Microsoft OLE DB Provider for Microsoft Jet
Article ID: 306435 - Last Review: June 25, 2004 - Revision: 4.3