Status Property (ADO Field)
Indicates the status of a Field object.
Return Value
Returns a FieldStatusEnum value. The default value is adFieldOK.
Remarks
This property always returns adFieldOK for fields of a Recordset object.
Additions and deletions to the Fields collections of the Record object are cached until the Update method is called. The Status property enables you to determine which fields have been successfully added or deleted.
To enhance performance, schema changes are cached until Update is called, and then the changes are made in a batch optimistic update. If the Update method is not called, the server is not updated. If any updates fail then an error is returned and the Status property indicates the combined values of the operation and error status code. For example, adFieldPendingInsert OR adFieldPermissionDenied. The Status property for each Field can be used to determine why the Field was not added, modified, or deleted. Status is only meaningfully exposed on the Record.Fields collection and not the Recordset.Fields collection.
Two problems can arise when adding, modifying, or deleting a Field. If the user deletes a Field, it is marked for deletion from the Fields collection. If the subsequent Update returns an error because the user tried to delete a Field for which they do not have permission, the Field will have a status of adFieldPermissionDenied OR adFieldPendingDelete. Calling the CancelUpdate method restores original values and sets the Status to adFieldOK. Similarly, the Update method may return an error because a new Field was added and given an inappropriate value. In that case the new Field will be in the Fields collection and have a status of adFieldPendingInsert and perhaps adFieldCantCreate. You can supply an appropriate value for the new Field and call Update again. Note that calling Resync instead requeries the provider.
See Also
Visual Basic Example | Visual C++ Example | Visual J++ Example
Applies To: Field Object