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

Run-time error '3052' 1

Status
Not open for further replies.

dbuuch

IS-IT--Management
Dec 15, 2003
17
US
i have a code that is used to zap a table before another one is called to populate it. this is the portion of the code:

Set rst = dbs.OpenRecordset("R100", dbOpenDynaset)
Do Until rst.EOF
With rst
rst.Delete
rst.MoveNext
End With
Loop
rst.Close

In recent times, however, i keep getting a run-time error (#3052) when the code hits the rst.delete line. the following is the error i get:
"File sharing lock count exceeded. Increase MaxLocksPerFile registry entry."

However, when i kill the code and keep re-trying to execute the same code, it always seem to work after a few attempts.

Can anyone help me figure this out?

Thanks,
Daniel
 
Why use recordset? Why not:

[tt]dbs.execute "delete from r100",dbfailonerror[/tt]

I don't know if that'll help on the errormessage, but it's more efficient. If you still get the error, try the suggetsion from the errormessage.

Roy-Vidar
 
Thanks Roy, it works and it seems more neat. Thanks you so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top