The information in this article applies to:
IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the "Restoring the Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe. Advanced: Requires expert coding, interoperability, and multiuser skills. This article applies only to a Microsoft Access database (.mdb). SYMPTOMSWhen you perform an operation on a table, you may receive the following error message if the operation creates a large number of page locks: If you run an action query on a large table, you may receive the following error message:
CAUSEThe page locks required for the transaction exceed the MaxLocksPerFile value, which defaults to 9500 locks. The MaxLocksPerFile setting is stored in the Windows Registry. RESOLUTIONThere are several ways to work around this behavior:
Method 1: Changing MaxLocksPerFile in the Windows RegistryWARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.For information about how to edit the registry, view the "Changing Keys and Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it. If you are running Windows NT, you should also update your Emergency Repair Disk (ERD). Use Registry Editor to increase the MaxLocksPerFile value under the following key:
Note that this method changes the Windows Registry setting for all
applications that use the Microsoft Jet database engine version 4.0.
Method 2: Using SetOption to Change MaxLocksPerFile TemporarilyNOTE: The sample code in this article uses Microsoft Data Access Objects. For this code to run properly, you need to reference the Microsoft DAO 3.6 Object Library.Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Solution Provider or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Solution Providers, please see the following page on the World Wide Web: http://www.microsoft.com/mcsp/For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.aspThe SetOption method temporarily overrides values for the Microsoft Jet database engine keys in the Windows Registry. The new value remains in effect until you change it again, or until the DBEngine object is closed. NOTE: Changes made to the MaxLocksPerFile setting using the SetOption method will only be available through the current session of Data Access Objects (DAO). Queries run through the Microsoft Access user interface, will still use the settings within the registry. The following code sample sets MaxLocksPerFile to 200,000 before executing an update operation inside a transaction:
Method 3: Setting the UseTransaction Property in an Action QueryIf a stored action query causes the error, you can set its UseTransaction property to No. Note that if you do this, you will not able to roll back your changes if there is a problem or an error while the query is executing:
MORE INFORMATIONThe MaxLocksPerFile setting in the Windows Registry prevents transactions in the Microsoft Jet database engine from exceeding a specified value. If a transaction tries to create locks in excess of the MaxLocksPerFile value, the transaction is split into two or more parts and partially committed. This feature was added to Microsoft Access 97 to prevent Netware 3.1 server crashes when the specified Netware lock limit was exceeded, and to improve performance with both Netware and Microsoft Windows NT. Steps to Reproduce BehaviorThe following example uses a Visual Basic procedure to create a table with 10,000 records in it, and then modifies the table in order to cause the error message:
REFERENCESFor more information about the SetOption method, in the Visual Basic Editor, click
Microsoft Visual Basic Help on the Help menu, type "SetOption method" in
the Office Assistant or the Answer Wizard, and then click Search to
view the topic. Additional query words: prb MaxLocksPerFile Netware
Keywords : kberrmsg kbdta |
Last Reviewed: July 6, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |