Acess error: "The number of file share locks overflows"

Source: Internet
Author: User

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;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.