Re: compare 2 recordsets



RB Smissaert wrote:
Would Seek know that the rs is sorted so stop seeking if it is past
the sought value?
This made me think that maybe a double loop could be faster as you
could set the start
point and do exit do or exit loop when it has past the value.
What complicates matters is the delete. What happens to the position
in the recordset after
a delete of the one single currrent record? Will it be in the next of
the previous.
How would a filter work?
Still haven't worked it out yet.


You also might try the effect of deleting the records that are found in
rsParentNode to reduce its size. Using Filter, that would mean:

rsNode.MoveFirst
Do While rsNode.EOF = False
strCriterium = strParentField & " = " & rsNode.Fields(lNodeField)
rsParentNode.Filter = strCriterium
If rsParentNode.EOF Then
rsNode.Delete adAffectCurrent
Else
do until rsParentNode.EOF
rsParentNode.Delete adAffectCurrent
loop
End If
rsNode.MoveNext
Loop


Another thing to try is using GetRows to put the rsParentNode data into an
array - looping through an array is much quicker than looping through a
recordset

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.



Relevant Pages

  • Re: DAO MUCH faster than ADO in this test
    ... DAO is well-known to be faster than ADO. ... Of course the DAO loop ran faster than the SQL loop; ... advantage of a table-type recordset, which only works on local tables. ... Dim starttime As Single, finishtime As Single ...
    (microsoft.public.access.modulesdaovba)
  • Re: Do While Loop nested in another While causes error
    ... still doesn't explain why a nested DO loop would cause problems. ... Until you sort out the contents of the recordset, ... idHolder = rsGuestbook ... display that new ID. ...
    (microsoft.public.inetserver.asp.db)
  • Re: One more ! Calculating Recordset Values
    ... Well I am almost there lol, got the recordset to work properly returning all ... the values in the one "loop" so to speak and I can see them being returned ... >> Dim aTot, eTot, iTot, pSubTot, aStrengthSubTot, PTotal, SubTotal, ... >>> totals ...
    (microsoft.public.frontpage.programming)
  • Re: One more ! Calculating Recordset Values
    ... EOF means that the end of the RecordSet has been reached. ... > 'Total = The sum of all the SubTotals ...
    (microsoft.public.frontpage.programming)
  • Re: Do While Loop nested in another While causes error
    ... still doesn't explain why a nested DO loop would cause problems. ... Until you sort out the contents of the recordset, ... display that new ID. ... response.Write the value of idHolder within the loopto see if it ...
    (microsoft.public.inetserver.asp.db)