ADO » DataControl » onError

Syntax:
onError(SCode, Description, Source, CancelDisplay)
SCode
The SCode parameter is an integer that is the status code of the error.
Description
The Description parameter is a string that describes the error.
Source
The Source parameter is a string that contains the query or command that generated the error.
CancelDisplay
The CancelDisplay parameter is a Boolean value that determines if a dialog box is displayed by the error. The default is False and a dialog box is not displayed. If True, a dialog box is displayed.

This event can be fired to handle errors encountered by DataControl.

The onError event can be fired to handle errors generated by the DataControl object.

An event is simply a subroutine that can be called automatically after a specific operation has occurred. This subroutine can contain any code that you need to run when the event occurs. The subroutine will only be called if it is included in your code.

There are four parameters passed to this event.

Examples

Code:
Private Sub objDC_onError( SCode, Description, Source, CancelDisplay )
   ' place any code you desire here, for example
   If CancelDisplay = False Then
      CancelDisplay = True
   End If
End Sub

See Also: