As you will see shortly, the user can manipulate the ADO Data Control to navigate
the Recordset. When the user attempts to move forward through the Recordset on
to the end-of-file buffer, Visual Basic must take some action to ensure that there
won't be a problem the next time the user tries to move forward.
The EOFAction property tells Visual Basic what to do when the user has moved
the ADO Data Control's record pointer on to the end-offile buffer. The three values
of EOFAction are as follows:
-
0 AdDoMoveLast (default) - The record pointer repositions itself
to the last true record in the Recordset, and thus avoids any future problems.
-
1 adStayEOF - The record pointer stays on the end-of-file buffer.
If you choose this option, you must programmatically provide for the record pointer pressing
End-of-file.
-
2 adDoAddNew - The AddNew method of the Recordset will execute, adding
a new record to the Recordset and enabling the user to edit its blank fields.
BOFAction has two possible values:
-
0 adDoMoveFirst (default) - The record pointer repositions itself to
the first true record in the Recordset, and thus avoids any future problems.
-
1 adStayBOF - The record pointer stays on the beginning-of-file buffer.
If you choose this option, you must programmatically provide for the record pointer by pressing
Beginning-of-file.
NOTE 1 - Setting the EOFAction Property: Set
the Data Control's EOFAction property to adStay EOF when you want to directly
program the Recordset's behavior. You will then need to put code in the ADO Data
Control's MoveComplete or EndOfRecordset event procedures to handle this possibility
NOTE 2 - The BOFAction Property: Set the Data
control's BOFAction property to adStayBOF when you want to directly program the
Recordset's behavior. You will then need to put code in the ADO Data Control's
MoveComplete event procedure to handle this possibility
See Also