[AccessD] MoveFirst needed in DAO?

Gustav Brock gustav at cactus.dk
Wed Aug 8 04:09:13 CDT 2012


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



More information about the AccessD mailing list