WillChangeField and FieldChangeComplete (ConnectionEvent) Methods (ADO)

See Also   Applies To

The WillChangeField method is called before a pending operation changes the value of one or more Field objects in the Recordset. The FieldChangeComplete method is called after the value of one or more Field objects has changed.

Syntax

WillChangeField cFields, Fields, adStatus, pRecordset

FieldChangeComplete cFields, Fields, pError, adStatus, pRecordset

Parameters

cFields   A Long. The number of Field objects in Fields.

Fields   An array of Variants. Contains Field objects with pending changes.

pError   An Error object. It describes the error that occurred if the value of adStatus is adStatusErrorsOccurred; otherwise it is not set.

adStatus   An EventStatusEnum status value.

When WillChangeField is called, this parameter is set to adStatusOK if the operation that caused the event was successful. It is set to adStatusCantDeny if this method cannot request cancellation of the pending operation.

When FieldChangeComplete is called, this parameter is set to adStatusOK if the operation that caused the event was successful, or adStatusErrorsOccurred if the operation failed.

Before WillChangeField returns, set this parameter to adStatusCancel to request cancellation of the pending operation.

Before FieldChangeComplete returns, set this parameter to adStatusUnwantedEvent to prevent subsequent notifications.

pRecordset   A Recordset object. The Recordset for which this event occurred.

Remarks

A WillChangeField or FieldChangeComplete event may occur due to the following Recordset operations: Value, and Update with field and value array parameters.