drft

S

shrirang

retret

-----Original Message-----
From: James Franklin [mailto:[email protected]]
Posted At: Thursday, June 23, 2005 2:11 PM
Posted To: microsoft.public.access
Conversation: File Sharing Lock Count Exceeded
Subject: Re: File Sharing Lock Count Exceeded


Thanks David, but this did not seem to have any effect. Have I done
something wrong?

Here is my code. I want to renumber the records sequentially to remove gaps
that appear. There may be up to 100k records in the tbl_Sales table, there
is also a related tbl_Sales_Details table, which updates automtacally due to
referential integrity.

ws1.BeginTrans

Set rstS = db1.OpenRecordset("tbl_Sales", dbOpenDynaset,
dbDenyWrite)

'loop through Sales, renumbering the Sale_ID sequentially.
'Sales Detail records should update by relationship.
With rstS
If Not .EOF Then
.MoveFirst
NextSaleID = !Sale_ID + 1
.MoveNext

Do Until .EOF
If !Sale_ID <> NextSaleID Then
.Edit
!Sale_ID = NextSaleID
.Update
Application.DBEngine.Idle 1 'free any unneeded
file locks
End If

NextSaleID = NextSaleID + 1
.MoveNext
Loop
End If
.Close
End With

ws1.CommitTrans


Once again, thank you for helping, I appreciate it.
Jim
 
Top