MaxLocksPerFile problem

kirkm

Registered User.
Local time
Today, 11:21
Joined
Oct 30, 2008
Messages
1,257
I'm attempting to add an ID field to my table of DataType Autonumber but keep getting error File sharing lock count exceeded. Increase MaxLocksPerFile registry entry.

On Googling there's instructions to enter
DAO.DBEngine.SetOption dbmaxlocksperfile,15000 into the immediate window.

However I find that does nothing, the error remains. (I also tried a value of 20,000)
My table has 16256 rows and 30 columns.

What value will work, or is ir better to change the setting in the registry
as described here https://support.microsoft.com/en-nz...r-message-during-large-transaction-processing
 
Thanks sneuberg, an append query did the job.

Just in case something references the table by column index number, I dragged the autonumber field over so it was last (right most position). This will work do you think?
 
Thanks sneuberg, an append query did the job.

Just in case something references the table by column index number, I dragged the autonumber field over so it was last (right most position). This will work do you think?
I don't think the position makes any difference but I've never seen anyone put an autonumber in the right most position. Usually they are placed in the left most position. I wonder if that's where the wizards expect them or whether they base their decisions on what's the primary key.

Edit: Just tried the combo box wizard and it correctly hides the primary key even when it's in the right most position.
 
Last edited:
I may be over thinking it. After
"Set rx = CurrentDb.OpenRecordset("Select * From..." .

Then rx(0) would be rx(1) etc. if autonumber was the first field.

But I can try and see.
 
Yeah it just dawned on my why you want to do that. The existing code of course. Now I think that's a good idea or at least the safest bet.
 

Users who are viewing this thread

Back
Top Bottom