Error Event

Fired after a data-access error.

Syntax

Private Sub VSFlexGrid_Error( ByVal ErrorCode As Long, ShowMsgBox As Boolean)

Remarks

This event is fired after a non-fatal data-access error. Normally, this error indicates that an update to the database failed because of the data was of the wrong type or because the value entered would violate database integrity rules.

The ErrorCode parameter can have the following values:

 

Error Code

Description

129

Recordset can't be updated. The record may be locked, or the recordset may be a read-only recordset.

130

Recordset field can't take this value. The value entered is of the wrong type or would violate database integrity rules.

 

If you do not handle this event, the control will display a message box informing the user that an error occurred. Execution will continue normally and the control will display the value as retrieved from the database.

You may trap this event to suppress the dialog box, optionally replacing it with a custom one.

See Also

VSFlexGrid Control