MaxLocksPerFile

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've just started using Access 2002 (10.4302.4219) SP-2 having not used Access for some time (basically at w98 level

Ive imported an Excel file of 31574 records each of 7 fields. 2 of the fields contain duplicated entries and I therefore tried to analyse the initial table into three, but when I try to finish the analysis I get back the message "File sharing lock count exceeded, Increase MaxLocksPerFile registry entry."

The current entry in the registry has a data value of 0x0000251c (9500)

I'm always nervous about amending values in the registry directly.

Anyone able to calm my fears?
 
Murray,

To set the number as you wish without editing the registry :-

Open the VBA editor and have the Immediate window opened in that.

In the immediate window type DAO.DBEngine.SetOption dbmaxlocksperfile,15000

Press enter to run the code.

This will temporarily set the property while you import your spreadsheet.
When you restart Access the property will be set back to 9500 as in the
registry.

HTH

Mark. mcse

Murray said:
I've just started using Access 2002 (10.4302.4219) SP-2 having not used
Access for some time (basically at w98 level)
Ive imported an Excel file of 31574 records each of 7 fields. 2 of the
fields contain duplicated entries and I therefore tried to analyse the
initial table into three, but when I try to finish the analysis I get back
the message "File sharing lock count exceeded, Increase MaxLocksPerFile
registry entry."
 
I've had to change the MaxLock many times and have done so without problems.
The knowledge base suggest setting the number to 100000. As long as you make
a copy of the registry before changing the value, then there should be no
worry in changing the value.
 
Include the following code in your procedure: -

Dim cnn As ADODB.Connection

Set cnn = CurrentProject.Connection
cnn.Properties("Jet OLEDB:Max Locks Per File") = 100000
Debug.Print cnn.Properties("Jet OLEDB:Max Locks Per File")

Regards

Aziz
 
Back
Top