469,658 Members | 1,855 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,658 developers. It's quick & easy.

File Sharing Lock Count Error -- ??

I have a database that has a form that opens a report using date
parameters. I have been using it for six months and last week I began
to get the following Error Message:

"File sharing lock count exceeded. Increase MaxLocksPerFile registry

I checked in the Tools - Options - Advance. I have the database shared
with no locks selected and record level locking selected.

Any idea where to start to look?

Thanks in advance.

Nov 12 '05 #1
1 15756
I found the answer on the www.microsoft.com - Knowledge Base.

I went in and fixed the max number on the registry edit: Below is what
is at their website.

256986 Description of the Microsoft Windows Registry
When one or more users process many transactions in a multi-user
environment, the transactions may fail with the following error
File sharing lock count exceeded. Increase MaxLocksPerFile registry
The error occurs if the number of locks required to perform a
transaction exceeds the maximum number of locks per file.
WARNING: If you use Registry Editor incorrectly, you may cause serious
problems that may require you to reinstall your operating system.
Microsoft cannot guarantee that you can solve problems that result
from using Registry Editor incorrectly. Use Registry Editor at your
own risk. To work around this problem, increase the maximum number of
locks per file. To do this, use one of the following methods:
Method 1: Set the Registry Key to MaxLocksPerFile to Increase the
Maximum Number of Locks Per File
1. Click Start, and then click Run.
2. Type regedit, and then click OK.
3. In Registry Editor, locate the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engi nes\Jet 4.0
4. In the right pane of Registry Editor, double click MaxLocksPerFile.
5. On the Edit DWORD Value dialog box, click Decimal.
6. Modify the value of the Value data box as required, and then click
Note This method changes the Windows registry setting for all
applications that use the Microsoft Jet database engine version 4.0.
Method 2: Use the SetOption Method to Temporarily Change
Note The sample code in this article uses Microsoft Data Access
Objects. For this code to run properly, you must reference the
Microsoft DAO 3.6 Object Library. To do so, click References on the
Tools menu in the Visual Basic Editor, and make sure that the
Microsoft DAO 3.6 Object Library check box is selected. The SetOption
method temporarily overrides the default number of locks per file. You
set the default number of locks per file when you set the
MaxLocksPerFile registry key. You set the new value by using the
SetOption method. The new value is valid until you close the DBEngine
object. To use Method 2, follow these steps:
1. Open Microsoft Access.
2. Open a database. In the left pane, click Modules.
3. In the right pane, right-click <Module Name>, and then click Design

Note If there are no existing modules, create a new one.
4. On the Microsoft Visual Basic -<Database Name>-[<Module Name>
(Code)] window, click Immediate Window in the View menu.
5. In Immediate Window, enter the following code
6. DAO.DBEngine.SetOption dbmaxlocksperfile
7. Press the ENTER key to run the line of code.

Note This temporarily sets the MaxLocksPerFile value to 15,000.
To process large transactions, set the MaxLocksPerFile value to meet
your requirement, and then run the transactions in the session.

Changes you make to the MaxLocksPerFile setting by using the SetOption
method are available only for the current session

Thanks anyway. Everyone

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Keith Wilby | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.