File sharing lock count exceeded. Increase MaxLocksPerFile registry

  • Thread starter Thread starter quickemr_groups
  • Start date Start date
Q

quickemr_groups

Hi all,

I am opening a database and simpy trying to alter the size of a text
column. The database I am testing with has about 160,000 records in
it. This code has worked successfully on other databases, but with
less records.

I open it like this:
Set cnData = New adodb.Connection
cnData.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
DataDBLocation & ";Jet OLEDB:Database"

And alter the table like this:
cnData.Execute "alter table MeasurementsT alter column Measurement2
char(250)"

When working with the 160,000 record table, I get the error message:
File sharing lock count exceeded. Increase MaxLocksPerFile registry

Now, I can certainly edit my own registry and increase this value, but
it would be very difficult and time consuming for me to do this on all
of my clients' computers across the country.

Is there some setting in my code that I can set so that they do not
get this error?

I'm using an Access 2002 database by the way.

Thanks in advance,

David
 
Using VB6, tried the suggestion starting at 50,000 then tried
100,000 , 200,000 , and finally 1,000,000. Still get the error.

-David
 
Is there an easy way to do that programmatically? I can't do that one
each of my clients databases. It would take me weeks!
 
Thanks for the help Chris. I was just hoping there was some setting I
could use in my code that would prevent that error from happening. I
read about the "DBEngine.SetOption dbMaxLocksPerFile" and was hoping
there was another alternative since it didn't seem to be working for
me.

-David
 
If I manally edit the registry key and change it to 50,000, it works!
The setting from VB6 does not seem to do the trick, however.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top