If you find this error when operating a large amount of data, especially in the year-end settlement statistics:
-------------
"File sharing lock overflow"
-------------
The reason is as follows:
An error is returned when you Access the database and perform a large number of operations (more than 9500 records.
Microsoft JET Database Engine error '80040e21'
Solution:
Modify registry
[HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Jet/4.0/Engines/Jet 4.0]
"MaxLocksPerFile" = dword: 05f5e0ff
Change the default value of MaxLocksPerFile to 9500 in decimal format. I changed it to 99999999 in decimal format.
---------
Solution:
-----------------
Reg: = TRegistry. Create;
Try
Reg. RootKey: = HKEY_LOCAL_MACHINE; // search for the Registry,
If Reg. OpenKey ('/SOFTWARE/Microsoft/Jet/4.0/Engines/Jet 100', False) then
Reg. WriteInteger ('maxlocksperfile', 99999999 );
Except
Reg. Free;
End;
Or:
Try
Reg: = TRegistry. Create;
Reg. RootKey: = HKEY_LOCAL_MACHINE;
Keyname: = '/SOFTWARE/Microsoft/Jet/4.0/Engines/Jet 100 ';
If Reg. OpenKey (KeyName, false) then
Begin
If reg. ValueExists ('maxlocksperfile') then
Reg. WriteInteger ('maxlocksperfile', 99999999 );
End;
Finally
Reg. Free;
End;