Re: compare 2 recordsets



Another thing to try is using GetRows to put the rsParentNode data into an array

Yes, will try that now.

RBS


"Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx> wrote in message news:%23tysTbrAIHA.4612@xxxxxxxxxxxxxxxxxxxxxxx
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: Error 3021
    ... The only thing I see is that after you open the recordset, ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ...
    (microsoft.public.access.modulesdaovba)
  • Re: fastest way to sort 2-D variant arrays?
    ... and then change the FSO loop section to loop through the ... array, and add the elements to the recordset using the AddNew statement. ... How would I write my variant array to the recordset? ... Here is something that I use on an ASP page to sort files by date there ...
    (microsoft.public.vb.general.discussion)
  • Re: [VB5) Faster way to read a text file?
    ... exceptions for raising error conditions with "proper" use of On ... I use Exit For semi-often, ... I've got an array that I am searching something for. ... why bother letting the loop run full if you ...
    (microsoft.public.vb.general.discussion)
  • Re: [VB5) Faster way to read a text file?
    ... for raising error conditions with "proper" use of On Error and/or ... I use Exit For semi-often, ... I've got an array that I am searching something for. ... they aren't really suggesting that one does let the "loop run full". ...
    (microsoft.public.vb.general.discussion)
  • Re: [VB5) Faster way to read a text file?
    ... What you've described is a very common usage of Exit For. ... would normally structure that with the equivalent While loop: ... While (Not blnFound) And ... I've got an array that I am searching something for. ...
    (microsoft.public.vb.general.discussion)

Quantcast