ADO » DataControl » onError

onError(SCode, Description, Source, CancelDisplay)
The SCode parameter is an integer that is the status code of the error.
The Description parameter is a string that describes the error.
The Source parameter is a string that contains the query or command that generated the error.
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 feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Applications that use RDS should migrate to WCF Data Service.

The onError event is deprecated in ADO.


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.


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: