MaxLocksPerFile / File sharing lock count exceeded

Thales750

Formerly Jsanders
Local time
Yesterday, 23:44
Joined
Dec 20, 2007
Messages
2,620
Last edited:
I have written several detailed posts on this topic over the past couple of years.
Unfortunately, the site Search & Similar Threads features both seem to be down at the moment.
However when normal service is resumed, search for MaxLocksPerFile and Isladogs to get a list of relevant links

The default registry value for MaxLocksPerFile = 9500 but it can be increased ...in small steps
In the meantime, the registry key location(s) will depend on your Access version & bitness as well as your Windows bitness
It is possible no key may exist if you've never specified a value - or you may have multiple such keys
Do a registry search for MaxLocksPerFile

In addition, registry keys for MaxBufferSize may be relevant.

Other relevant items include:
a) the number of available connections - see Available Connections - Mendip Data Systems
b) large address awareness - see Phillip Stiefel's webpage mentioned in this post: Use large address awareness to fix out of memory issues in 32-bit Access - Microsoft Access / VBA (bytes.com)

Hope that helps
 
Did you also try to look for this one?

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\x.0\Access Connectivity Engine\Engines\ACE
No sir, I thought that was for 64 bit. I'll try.
 
Wow6432Node is for 32-bit Access in 64-bit Windows
 
without messing with Registry, you can set it in your db.

Public Function fncMaxLocks(Optional Byval lngLocks As Long = 1000000)
dbEngine.SetOption dbMaxLocksPerFile, lngLocks
End Function

you can create an Autoexec macro and Call the function (RunCode).
 
At the customer location this database is running on SQL Server. so I'm betting they will not experience this problem. After moving this 200 table database to SQL Server i will never build another one in ACE.
 
It turns out this is not actually about the Registry. I haven't looked yet, but there is code causing this. Maybe a loop that is creating tens of thousands of locks. We'll see.
 
If so, this is a case where life follows art, more specifically the book Everything I Need to Know, I Learned in Kindergarten. And one of those early life lessons was "if you open it, close it." But also, if there is an explicit file-open going on, besides using the Close # command, also look at these commands to help with releasing file locks:

 

Users who are viewing this thread

Back
Top Bottom