I have logic that passes thru a local table with 300K records. What the routine does is simple but it keeps stopping with the 'File sharing locks exceeded' when I get to around record 10,000.
I did some research about this issue on EE and added the statement
DAO.DBEngine.SetOption dbMaxLocksPerFile, 200000
At the top of the processing. There was no change, the error still occurred around record 10,000.
I also saw that registry revision is another way of handling this issue but that wouldn't work because I would have to do it on every user machine. There are close to 40 users.
When I first wrote the routine it processed all 300k records with no issues, this problem came later.
Since this is a local table there is no need for any locks on the table. No one but the current user will access it.
I pretty much use the same open statement on all of my ADO files. Is there something that I can do to make the open more suitable for this process. I don't know the effect of the options. Here is the open I use.
I checked to make sure and I do have other processing loops that go thru over 300k records without this issue but this one throws the error every time.
One possibly key difference is that in this case the loop involves only one table. I am passing thru a table and updating each records as I pass thru.
Thanks for the responses, as I mentioned above I already tried switching between Optimistic and Pessimistic with no change.
jimpen:
First question: Would a user have to have a certain level of authority to execute the code that revises the registry? If so, it may work for me when I test it but won't work for all users in the production environment.
Is this code specific to operating system?
I cut and pasted your code into my app and got a runtime error. I attached the message
The specific line of code that threw the error was:
myWS.RegWrite i_RegKey, i_Value, i_Type
which is the last line in Sub RegKeySave
Jim P.
First question: Would a user have to have a certain level of authority to execute the code that revises the registry?
I can't tell you. All our users are local admins on their workstations.
But the error is because it's trying to use VBS to modify the registry on a Win7 machine.
I've been using it on XP/2K3 machines up until now.
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Since you are using ADO (right?), I'm not sure DAO.DBEngine.SetOption dbMaxLocksPerFile applies anyway. And if it's not working, then the Reg entry is not going to work either.
One possibly key difference is that in this case the loop involves only one table. I am passing thru a table and updating each records as I pass thru.
Very confused.