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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to free locks imm. after .Edit to avoid MaxLocksPerFile prolem??

Status
Not open for further replies.

dirkg

Technical User
May 20, 2000
170
BE
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 (Windows NT) where I want to install my program. 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 95. It seems that Access 2000 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...:-(

Thanks a lot for your help and a mery Christmas to all!

Greetings,


Dirk


PS: this thread is related to the one I started in the general forum but I thought that this forum is more appropriate now that I have found out a bit more about the problem. The other thread I'm talking about is thread181-43391
 
I would "rem" that lock code out for a minute and test it.
I never put it in.
If Access 2000 is better suited for Client/Server apps then its taking care of it for you.

DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
 
I recommend that you use ADO instead of DAO and you add :

set RS = NOTHING
set connection=NOTHING

This should solve your problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top