[AccessD] MoveFirst needed in DAO?

Stuart McLachlan stuart at lexacorp.com.pg
Wed Aug 8 16:50:33 CDT 2012


"when getting a count" - you need to, but if you are just going to step through the recordset, 
there is no need to.


On 8 Aug 2012 at 14:27, David McAfee wrote:

> I missed the beginning of this thread, so I might not totally understand
> what was being discussed here.
> 
> Am I the only one that makes a habit of always moving last then first
> before getting a count?
> 
> if Not rs.BOF and not rs.EOF
>    rs.MoveLast
>    rs.MoveFirst
>    debug.print rs.recordcount
> else
>    'empty recordset
> end if
> 
> On Wed, Aug 8, 2012 at 2:12 PM, Jim Lawrence <accessd at shaw.ca> wrote:
> 
> > I knew it was a problem with ADO type recordsets which may just start at
> > the
> > bottom instead of the top. I think DAO type recordsets always seem to start
> > at the top unless there was some intermediate processing.
> >
> > OTOH using the style, you displayed, would work for any recordset so a
> > developer could create simple universal recordset handling code and
> > classes.
> >
> > Jim
> >
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list