<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1264" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear List:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I am getting an error in a loop which
says:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>File sharing lock count exceeded. Increase
MaxLocksPerFile registry entry.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I don't think that's the solution. The lock
limit should not be exceeded. Somehow I'm not releasing the locks as
they're being created. Is there a trick to doing that? It blows at
different counts, too. Sometimes over 70,000 records get processed,
sometimes 40,000.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Here's the code:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>'********************************************************************************</FONT></DIV>
<DIV><FONT face=Arial size=2>Set rstTaxRate = db.OpenRecordset("Select * FROM
tblTaxRates")<BR>Set rstRecoveryTable = db.OpenRecordset("Select * FROM
tblPrintRecoveryForm")</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>With rstRecoveryTable</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>If .BOF = True And .EOF = True Then GoTo
GoodBye:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>.MoveLast<BR>txtTotalRecords =
.RecordCount<BR>.MoveFirst<BR>lngCount = 0</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Do While Not .EOF</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> lngCount = lngCount +
1<BR> If lngCount Mod 1000 = 0
Then<BR> txtRecordNumber =
lngCount<BR>
Me.Repaint<BR> End If<BR>
<BR> .Edit</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> If
Nz(!fldInvoiceDetailPriceShouldBe) = 0
Then<BR> !PriceError =
0<BR> !TotalDue =
0<BR> End If<BR> <BR> If
Nz(!fldInvoiceDetailPricePaid) < 0
Then<BR> !PriceError =
!fldInvoiceDetailPricePaid<BR>
!TotalDue = !PriceError * !fldInvoiceDetailQuantity<BR> End
If<BR> <BR> If !fldInvoiceDetailSalesTax =
"Y" Then<BR>
<BR> ' find tax rate for this invoice
date; if not found, tax is zero<BR>
rstTaxRate.FindFirst "fldTaxRateStartDate <= #" & !fldInvoiceDate
_<BR> & "#
AND fldTaxRateEndDate >= #" & !fldInvoiceDate &
"#"<BR>
<BR> If rstTaxRate.NoMatch = False
Then<BR>
!SalesTax = !PriceError *
rstTaxRate!fldTaxRate<BR>
!TotalDue = (!PriceError + !SalesTax) *
!fldInvoiceDetailQuantity<BR> End
If<BR> <BR> End
If<BR> <BR> .Update<BR>
<BR> .MoveNext<BR>Loop</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>End
With<BR>'*************************************************************************</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Any hints?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>MTIA,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Rocky Smolin<BR>Beach Access Software</FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV></FONT>
<DIV><FONT face=Arial size=2> </DIV></FONT></BODY></HTML>