while not eof taking lot of time 
Author Message
 while not eof taking lot of time

Hi,

I have while loop to loop through a record set and it is taking a lot
of time even if there are no results returned in the recordset.

I have a recursive function call within which I am using an ADO
recordset so it just adds up on time. Now I know that the
command.execute is not taking too much time since if I comment out the
while loop I get  a fairly fast response ( it takes about 1/6th of the
time without the while loop). I am stumped with this since in all the
recursive function calls it is only once that the recordset is
actually non-empty.

Any ideas?

Thanks



Tue, 18 Jan 2005 01:27:10 GMT  
 while not eof taking lot of time
you can use

dim x as integer
for x = 1 to Recordset.recordcount

....

next x

to loop thru the rs. i will loop thru once, not taking the
time to check for eof on every iteration.

lloyd

Quote:
>-----Original Message-----
>Hi,

>I have while loop to loop through a record set and it is
taking a lot
>of time even if there are no results returned in the
recordset.

>I have a recursive function call within which I am using
an ADO
>recordset so it just adds up on time. Now I know that the
>command.execute is not taking too much time since if I
comment out the
>while loop I get  a fairly fast response ( it takes about
1/6th of the
>time without the while loop). I am stumped with this
since in all the
>recursive function calls it is only once that the
recordset is
>actually non-empty.

>Any ideas?

>Thanks
>.



Tue, 18 Jan 2005 23:01:41 GMT  
 while not eof taking lot of time
My problem is that even recordcount takes the same amount of time as
eof. Since most of the time in the iteration (this querying is being
done in a recursive function call), the recordset is empty. So it does
not matter if eof is calculated once or many times since in most cases
it is being evaluated just once and even then it is taking too long (I
counted the no. of recursive iterations to be 148 and each eof or
record count took 0.25 seconds approx and only once the recordset was
non-empty).
Quote:

> you can use

> dim x as integer
> for x = 1 to Recordset.recordcount

> ....

> next x

> to loop thru the rs. i will loop thru once, not taking the
> time to check for eof on every iteration.

> lloyd

> >-----Original Message-----
> >Hi,

> >I have while loop to loop through a record set and it is
>  taking a lot
> >of time even if there are no results returned in the
>  recordset.

> >I have a recursive function call within which I am using
>  an ADO
> >recordset so it just adds up on time. Now I know that the
> >command.execute is not taking too much time since if I
>  comment out the
> >while loop I get  a fairly fast response ( it takes about
>  1/6th of the
> >time without the while loop). I am stumped with this
>  since in all the
> >recursive function calls it is only once that the
>  recordset is
> >actually non-empty.

> >Any ideas?

> >Thanks
> >.



Wed, 19 Jan 2005 07:42:53 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. While not rs.eof taking inordinate amount of time

2. while not.eof taking too long

3. Structured Storage : Saving a variant stream takes lot of time ?!

4. adding lots and lots of pictures to the executable

5. Lots and Lots of Controls slow things down....

6. LEARN SQL AND SAVE YOURSELF A LOT OF TIME

7. Problem with applying time taken off to a date range

8. DAO garbage cleanup taking a LONG time...

9. Set word = nothing takes a looong time

10. Why creating tasks takes increasing time?

11. Set word = nothing takes a looong time

12. It takes a long time to open Form

 

 
Powered by phpBB® Forum Software