>lnLoop = int(lncount/1000)
This works. At first, I tried Math.Int() and thought it was not supported. Now, from your post, I remember that Int() can be used as is.
This is part of a class that is used to insert in batch. I have a class InsertRow which is used to insert one record at a time into a table with all the data dictionary validations. But, sometimes, there could be a used to insert in batch thousands of records, where we do no need to validate against the data dictionary. In this case, I can call the InsertInRow class to insert thousdands of records in a flash.
lnLoop was used to determine the number of loops as SQL Server can only insert in batch up to 1000 records at a time if I recall corrrectly. So, the part that negotiates with that is as follow:
If lnCount = 0 Then
Return True
End If
lnLoop = Int(lnCount / 1000)
If lnLoop = 0 Then
lnLoop = 1
End If
For lnCounter = 1 To lnLoop
lnStart = (lnCounter * 1000) - 1000
lnMax = Math.Min(lnStart + 1000, lnCount)
For lnCounter2 = lnStart To lnMax - 1
loRow = oDataProvider.oDataSet.Tables("Temp").Rows(lnCounter2)