- Use Regedit.exe or Regedt32.exe to edit the Windows Registry, and permanently change the MaxLocksPerFile value.
- Use the SetOption method of the DBEngine object to temporarily change the MaxLocksPerFile value in the code.
Method 1: Change MaxLocksPerFile in the Windows RegistryImportant This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
- From the Windows Start menu, click Run, type Regedt32.exe, and then click OK to start Registry Editor.
- Locate the MaxLocksPerFile value under the following key in the registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Jet 4.0NOTE: If the MaxLocksPerFile value does not exist, you must create it.
- Decrease the MaxLocksPerFile value.
- Quit Registry Editor.
Method 2: Use SetOption to Change MaxLocksPerFile TemporarilyMicrosoft 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 Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:
Microsoft Certified Partners - https://partner.microsoft.com/global/30000104
Microsoft Advisory Services - http://support.microsoft.com/gp/advisoryservice
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMSThe 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.
The following code sample sets MaxLocksPerFile to 128 before it runs an update operation inside a transaction:
On Error GoTo MDBUpdate_Error
Dim db As DAO.Database, ws As DAO.Workspace
' Set MaxLocksPerFile.
DBEngine.SetOption dbMaxLocksPerFile, 128
Set db = CurrentDb
Set ws = Workspaces(0)
' Perform the update.
db.Execute "UPDATE TableName SET Field1 = 'Updated Field'", _
MsgBox Err & " " & Error
MsgBox "Operation Failed - Update Canceled"
Artikelnummer: 305995 – Letzte Überarbeitung: 19.06.2014 – Revision: 1