By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,830 Members | 682 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,830 IT Pros & Developers. It's quick & easy.

File Sharing Lock Count Error -- ??

P: n/a
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
entry."

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.

Robert
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
SYMPTOMS
When one or more users process many transactions in a multi-user
environment, the transactions may fail with the following error
message:
File sharing lock count exceeded. Increase MaxLocksPerFile registry
entry.
CAUSE
The error occurs if the number of locks required to perform a
transaction exceeds the maximum number of locks per file.
WORKAROUND
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
OK.
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
MaxLocksPerFile
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
View.

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
,15000
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
Robert

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.