Fix access file sharing lock count exceeded error

Are you encountering “File sharing lock count exceeded…” error message in your Access Database during large transaction processing? What fixes are you trying to resolve this specific error code? Still nothing…? Don’t worry as this blog gives you the complete solution on how to fix this maxlocksperfile Access 2016/2013/2010/2007 error.

About Access File Sharing Lock Count Exceeded Error:

In windows, there are certain limits for sharing files concurrently. If this limit exceeds for any reason, then this stops file sharing operation. There is a registry element called MaxLocksPerFile entry  that monitors and take care of maximum file sharing limit. So, when this file sharing limit exceeds, you will get the following error on your system screen.

File sharing lock count exceeded. Increase MaxLocksPerFile registry entry

Practical Scenario:

I’m trying to import data from an Excel into Access but have been running into the

File sharing lock count exceeded. Increase MaxLocksPerFile registry entry.

So I went into the registry and after multiple increases of the value (from 251c up to 41ffffff) and applying this to all variations of the file within the registry (I found 4 relevant ones), it still didn’t work.

So i guess my question would be to clarify what exactly is being locked in?

Because the excel sheet I’m importing has 2500 rows and 50columns so i don’t understand where the huge number of locks would be needed for?

I’m using Access 2010.

Symptoms

When single or multiple users work on any transaction in Access Database multi-user environment. At that time transaction may fail with following error message:

File sharing lock count exceeded. Increase MaxLocksPerFile registry entry.

File-sharing-lock-count-exceeded

Cause

File sharing lock count exceeded Access error occurs if the number of locks required to perform a transaction exceeds the maximum number of lock per file.

How To Fix Access 3052 File Sharing Lock Count Exceeded Error?

file sharing lock

Well this File Sharing Lock Count Exceeded error can be easily fixed by modifying the registry. However serious problem might occur if you modify the registry incorrectly. So make sure that you follow these steps carefully without doing any mistake.

It’s better if you back-up the registry before you modify it. So that if in case any problem occurs then you can easily restore the registry.

Here is the following article in the Microsoft knowledge base regarding backup and restoration of the registry in windows:

322756 How to back up and restore the registry in Windows

To fix this problem and to increase the maximum number of locks per file. Use one of the following methods to resolve File Sharing Lock Count Exceeded Error.

Method 1: Set the registry key to MaxLocksPerFile to increase the maximum number of locks per file

  1. Tap to the Start option, and then hit the Run option.
  2. In the opened dialog box type regedit, and then hit to the OK option.
  3. Try out this appropriate method:
  • In Microsoft Access 2000, in Microsoft Access 2002, and in Microsoft Office Access 2003 that are running on a 32-bit Windows operating system, use Registry Editor to locate the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Jet 4.0

In MS Access 2000/ 2002/ 2003 that are running on 64 bit windows operating system, use Registry Editor to locate the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Jet\4.0\Engines\Jet 4.0

  • In MS Access 2007 which is running on 32 bit windows operating system, use Registry Editor to locate the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Access Connectivity Engine\Engines\ACE

Whereas, the MS Access 2007 which is running on 64 bit windows OS, make use of the Registry Editor to locate the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\12.0\Access Connectivity Engine\Engines\ACE

  1. In the right pane of your Registry Editor, double click
    MaxLocksPerFile.
  2. On the Edit DWORD Valuedialog box, tap to Decimal.
  3. Make changes to the value of the Value data box as required, and then tap to the OK option.

Note:

Applying this method can make changes in the windows registry setting for all the system application that uses the Microsoft Jet database engine version 4.0.

Method 2: Use the SetOption method to temporarily change MaxLocksPerFile

 

File sharing lock count exceeded

Note: Codes mentioned in this post uses Microsoft Data Access Objects. To run this code correctly, reference the Microsoft DAO 3.6 Object Library. 

To do this, tap to the References option on the Tools menu in the Visual Basic Editor, and make sure that the Microsoft DAO 3.6 Object Library check box is selected properly.

Well this SetOption method overrides the default number of locks per file temporarily.  Set the default number of locks per file when you set the MaxLocksPerFile registry key.

Set the new value by making use of the SetOption method. In this the new value is valid until you close the DBEngine object. Here are the steps to follow this.

  1. Firstly you need to open Microsoft Access.
  2. Open database, and then press Alt+F11 to launch the Visual Basic editor.
  3. On the Microsoft Visual Basic -<Database Name>-[<Module Name> (Code)] window, click Immediate Windowin the View
  4. In Immediate Window, write down the following code:

DAO.DBEngine.SetOption dbmaxlocksperfile, 15000

  1. Press ENTER key to execute the line of code.Note: This temporarily sets the MaxLocksPerFile value to 15,000.

In order to process large transaction, set the MaxLocksPerFile value to fulfill the requirement and then run the transaction in session.

Modifications done in the MaxLocksPerFile setting make using of the SetOption method that are only available for current session.

ALSO READ

How To Unlock MS Access .mdb or .accdb Database

How To Resolve Access Database Record Locking Issue During Multi-User Access?

Method 3: Making Use Of The DWORD

Following steps involve registry manipulation and this affects your system adversely. So, carefully edit registry entries and make some system restore point first.

  1. Press Windows Key + Rtogether this will open the run window.
  2. Type regedit in Run window and hit Enter to open the Registry Editor.

Navigate Here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\x.0\Access Connectivity Engine\Engines\ACE (if you’re 32-bit Windows edition)

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\x.0\Access Connectivity Engine\Engines\ACE (if you’re 64-bit Windows edition)

Substitute the placeholder x.0 with 15.0 for Outlook 2013, 14.0 for Outlook 2010, 12.0 for Outlook 2007, and 11.0 for Outlook 2003.

3. In right pane of the registry location, search for the MaxLocksPerFile named registry DWORD (REG_DWORD) whose default value is the main cause of this issue. the default value here is 9500 in decimal base, so make a double tap on the same DWORD to get this:

4. Now in the Edit DWORD Valuebox, increase the Value data from default one to your requirement. Set it to 15000. But make sure the selected base is the Decimal one and click OK.

5. After then close the Registry Editor and restart Windows/File Explorer to see the changes. Now try the file sharing simultaneously and this time you won’t face any issue.

Final Verdict:

Well this MaxLocksPerFile setting actually helps in determining the maximum number of locks Microsoft Jet places against a file. Default MaxLocksPerFile value is 9,500. So, don’t change this value if you are working on Novell NetWare server as the in this server records lock per connection is 10,000.

Let us know if this helps you just by sharing your experiences in our comment section!

3 Easy Fixes To Resolve MS Access 3052 :“File Sharing Lock Count Exceeded” Error