MaxLocksPerFile / File sharing lock count exceeded (1 Viewer)

Thales750

Formerly Jsanders
Local time
Today, 17:35
Joined
Dec 20, 2007
Messages
2,116
Last edited:

isladogs

MVP / VIP
Local time
Today, 22:35
Joined
Jan 14, 2017
Messages
18,234
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:35
Joined
Oct 29, 2018
Messages
21,474

Thales750

Formerly Jsanders
Local time
Today, 17:35
Joined
Dec 20, 2007
Messages
2,116
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.
 

isladogs

MVP / VIP
Local time
Today, 22:35
Joined
Jan 14, 2017
Messages
18,234
Wow6432Node is for 32-bit Access in 64-bit Windows
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:35
Joined
May 7, 2009
Messages
19,245
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).
 

Thales750

Formerly Jsanders
Local time
Today, 17:35
Joined
Dec 20, 2007
Messages
2,116
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.
 

Thales750

Formerly Jsanders
Local time
Today, 17:35
Joined
Dec 20, 2007
Messages
2,116
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.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 16:35
Joined
Feb 28, 2001
Messages
27,188
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

Top Bottom