Freetutes.com

VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

VB .NET - Learn Visual Basic .NET

Systems Analysis - System analysis and Design tutorial for Software Engineering


You are here: Visual Basic > Advanced VB6 tutorial > Chapter 8

The ADO Data Control's EOFAction and BOFAction Properties in VB6

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

 


  

<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © Freetutes.com | All Rights Reserved