VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering

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

The ADO Control's Error Event in Visual Basic 6 (VB6)

This event happens when the ADO Data Control's own internal data navigation and manipulation routines encounter a runtime error.

If the user clicks one of the ADO Data Control's navigation buttons and Visual Basic attempts to move to a record that has already been deleted, for instance, a runtime error could happen.

Because none of your code will be running when the user clicks the Data Control, you must put error-handling code for such eventualities in the ADO Data Control's Error event procedure.

The Error event's parameters help you to get information about the source and nature of the error that has fired this event. The final parameter also enables you to decide whether to allow VB to show an automatic error message to the user.

The parameters are as follows:

  • ErrorNumber The internal error number.

  • Description Error description string.

  • Scode A native error code number from the data server.

  • Source A String indicating where this error occurred.

  • Helpfile Path and name of a help file containing information about this error (supplied by the object that raised this error).

  • HelpContext A Help topic context number for the Helpfile (supplied by the object that raised this error).

  • fCancelDisplay Set this parameter to True to keep VB from displaying an automatic error message to the user.

See Also


<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © | All Rights Reserved