Corrupt Microsoft Access MDB Causes - OpLocks

[ Corrupt MDB Causes | Corrupt MDBs | AccessMain ]

Access, and other software, has some Opportunistic Locking (OpLocks) problems with Win NT 4.0, Windows 2000 and Novell servers commonly known as the OpLocks problem.   One comment in the newsgroups stated "We were getting all sorts of weird errors, lost indexes, primary keys, and not just on compact operations."   See How to Minimize Database Corruption When Using Microsoft Jet 4.0 - 300216. This article also links to articles covering other other versions of Access although they are virtually duplicate. 

This problem will frequently appear in the following circumstances:
- When you add your first Windows 2000/Windows XP, or Windows NT 4.0 of course, workstation to a network with a Windows NT 4.0/2000/2003 server.   Previously there's only been Win 95/98/ME workstations on the network. 
- Converting from NT 4 Server to Windows 2000 Server
- Converting to Access 2000 from Access 97 also appears to bring up this problem. Also note that this same situation can greatly decrease Access performance on the network.  

Novell Netware can also have this problem.

More details on the specific registry changes to disable OpLocks are at Configuring Opportunistic Locking in Windows - 296264.  Note that you want to add, or update, the LanmanServer setting.   The MRXSmb entry is for the client workstations.  You must reboot the server for the registry change to take effect.

For NT 4.0 see PC Ext: Explanation of Opportunistic Locking on Windows NT - 129202. Some more technical info is at Level II Oplocks Are Not Granted After a File Is Locked - 306981. OpLocks probably does not need be disabled on NT 4.0, Win 2000 and Win XP clients as well. However there is at least one credible report indicating they had to turn off OpLocks on client workstations before the problem disappeared.  

Other problems can affect this too.  For example Opportunistic Locking May Not Be Granted If Windows Is Installed by Using Sysprep - 812599 and Client Programs Stop Responding While They Wait for File Locking to Occur - 823272

Supposedly Windows 2000 SP3 has the necessary fix for this problem.  However Win2K SP3 must be loaded on both the server and all the workstations.  There are reports indicating though that this may not be sufficient and that you still have to set the above registry setting.

There are rare reports of performance problems with just changing the registry entries. For example "But after my customer switched off OpLocks in the registry, the opening of Quark XPress files from the server became extremely slow."    Thus the fixes mentioned at Cache May Not Clean Up When the SMB File Handle Is Closed - 307982 are then required.

The problem with installing patches is that a system may later be added to the network or have Windows deleted and re-installed without the patch thus corrupting the MDB again.  The solution there is to use the various API calls available and am checking the version number and date/time of a crucial file(s) to ensure it matches what I have on my system. See the Verify Appropriate Jet Service Pack is installed tips page at my website for more details including sample code:

Opportunistic Locking and Read Caching on Microsoft Windows Networks - A Data Access Worldwide White Paper.  This document explains the issues from the perspective of a different product but it still quite relevant.

Related messages from other software such as Excel or Word

File Lock or Access Denied Error Message When You Save Files Over the Network - 812937 When you try to save a file such as a Microsoft Excel workbook that you opened by using a universal naming convention (UNC) path, you may receive an error message that is similar to one of the following:
Cannot read file. File is locked
Access Denied
Lock Error

[ Corrupt MDB Causes | Corrupt MDBs | AccessMain ]

Auto FE Updater   Auto FE Updater distribute new and updated Front End databases to your users with several mouse clicks.

Wrench and gear Granite Fleet Manager - the best designed fleet maintenance tracking and management system available

Comments email Tony  Search Contact Tony's Blog Privacy Policy Table of Contents

Website copyright 1995-2013 Tony Toews