[AccessD] MoveFirst needed in DAO?

Jim Dettman jimdettman at verizon.net
Wed Aug 8 16:45:52 CDT 2012


No, you have to movelast to get an accurate count.   Jet may not fully populate the record set before the first record is returned

Jim

Sent from my iPhone

On Aug 8, 2012, at 5:27 PM, David McAfee <davidmcafee at gmail.com> 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