Jim Lawrence
accessd at shaw.ca
Wed Aug 8 16:12:22 CDT 2012
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 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, August 08, 2012 2:09 AM To: accessd at databaseadvisors.com Subject: [AccessD] MoveFirst needed in DAO? Hi all Having opened a DAO recordset: Set rst = dbs.OpenRecordset(strSQL) often the first code line following is: rst.MoveFirst or, if the recordset can be empty: If rst.RecordCount > 0 Then rst.MoveFirst EndIf But is that really necessary? At which record could the recordset possibly be positioned if not at the first? Even a snapshot or an ODBC linked recordset will not - as far as I know - move anywhere until you tell it to do so. For ADO recordsets it is different as the recordcount can be -1 until you, for example, have done a MoveLast. /gustav -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com