Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to solve MaxLocksPerFile problem without changing registry?

Status
Not open for further replies.

surotkin

Programmer
Dec 10, 2003
103
CA
Hi all!

My code is causing a violation against the MaxLocksPerFile in the registry. I could solve this problem by increasing that value, but unfortunately I do not have Access to the registry in the environment (Windows2000) where I want to install my program (even though it worked on my developer machine). Therefore I'm trying to find out what causes this problem and how I can prevent it. So far I discovered already that the problem is caused by the following code

dim dbs as database
dim rst as recordset

set dbs = currentdb
set rst = dbs.openrecordset ("A NORMAL SELECT-QUERY")

do until rst.EOF

rst.edit
.....
rst.UPDATE

rst.MoveNext
loop

rst.close
dbs.close

=> apparentlty the records remain locked after the edit-statement. I didn't have this problem when using Access 97. It seems that Access2002 has much more features for client-server structures but I'll have to learn how to use them. Therefore I would like to know as what type and what options I have to give to my recordset in order to achieve that each record is un-locked directly after the rst.UPDATE statement. In the help-files I didn't find an answer that solved my problem...

I tried to use ADO recordset instead of DAO, however it didn’t helped.

Thanks.
surotkin
 
Hi Remou,
Yes, I have seen that. However, my question is - is there any other way to solve the problem without changing MaxLocksPerFile settting?

surotkin
 
Original post said:
but unfortunately I do not have Access to the registry
Sorry, I thought you did not wish to change maxlocksperfile in the registry. The link offered the possibility of changing maxlocksperfile temporarily in code, so I thought that would suit.
 
Remou,
I believe the problem with locking could be eliminated by using appropriate options when you open a recordset. That's what I want to find out.
Thanks for effort.

surotkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top