Re: ... after Opening a record set

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Allcomp (fa097770_at_nospam.skynet.be)
Date: 06/28/04


Date: Mon, 28 Jun 2004 08:44:58 +0200

Hello,

I have seen a mistake sometimes depending on the recordset's option.
To solve that, I make
with Recordset
If .Recordcount > 0 then
.movelast
.Movefirst
for i = 1 to .Recordcount
....
....
...
next i
endif
.Close
I have made a program that must import millons record from multiple tables,
and convert them...
I am 20 to 30% faster by doing the .movelast, .movefirst and .Recordcount
than by using the .EOF.
You must know that the .EOF is a method that is launched every time. The
.movelast, .Movefirst and .Recordcount is one time 3 methods. and after that
only numbers are compared instead of a method .EOF
It is the same with MSDE and Sybase (speed and correct recordcount), record
on server or client

Marc Allard
Allcomp

"Al Reid" <areidjr@reidDASHhome.com> a écrit dans le message de
news:OGwP1MqWEHA.2576@TK2MSFTNGP10.phx.gbl...
>
> "Allcomp" <fa097770@nospam.skynet.be> wrote in message
news:eyJaL2nWEHA.4032@TK2MSFTNGP11.phx.gbl...
> > Hello,
> >
> > It is also possible to use Recordset.Recordcount
> > It will say the number of records returned by the recordset.
> >
> > After opening a recordser, I always make for i = 1 to rs.Recordcount.
> >
>
> It is not a reliable method of retrieving records from a recordset. Yes,
It may work for you with MS Access and Cursor location of
> adUseClient, but other than that, one is asking for trouble. Looping thru
the recordset while EOF is False will always work.
> --
> Al Reid
>
> "It ain't what you don't know that gets you into trouble. It's what you
know
> for sure that just ain't so." --- Mark Twain
>
>
> >
> > Marc Allard
> >
> >
> > "Dale" <dale0610@hotmail.com> a écrit dans le message de
> > news:u9ImoEhWEHA.2972@TK2MSFTNGP12.phx.gbl...
> > > Thanks guys, I have seen different methods used including the .EOF. I
> > > have just cut n' pasted which code from other parts of the program.
If
> > > testing for .EOF is the best way of doing it, I'll use this method.
> > > Thanks again.
> >
> >
>
>



Relevant Pages