ADO Status Attribute

Definition and Usage

The Status attribute can return a FieldStatusEnum Value, indicating the state of the Field object. The default value is adFieldOK.

If the update fails, an error will be returned, and the Status attribute will indicate the composite value and error status code of the operation. The Status attribute of each Field can be used to determine the reason why the Field was not added, modified, or deleted.

Problems with adding, modifying, or deleting a Field are reported through this property. For example, if a user deletes a field, it will be marked as deleted in the Fields collection. If the Update call returns an error due to the user trying to delete a Field that they do not have permission to delete, the Status of the Field will be adFieldPermissionDenied or adFieldPendingDelete.

Syntax

objfield.Status

Instance

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open "Select * from orders", conn
response.write(rs.Fields(0).Status)
rs.Close
conn.close
%>

FieldStatusEnum value

Constant Value Description
adFieldOK 0 Default. Indicates that the field has been successfully added or deleted.
adFieldCantConvertValue 2 Indicates that the field cannot be retrieved or stored without data loss.
adFieldIsNull 3 Indicates that the provider returned a Null value.
adFieldTruncated 4 Indicates that variable-length data is truncated when reading from the data source.
adFieldSignMismatch 5 Indicates that the data value returned by the provider is signed, while the data type of the ADO field value is unsigned.
adFieldDataOverflow 6 Indicates that the data returned by the provider exceeds the data type of the field.
adFieldCantCreate 7 Indicates that the field cannot be added because the provider has exceeded the limit (such as the number of allowed fields).
adFieldUnavailable 8 The provider cannot determine the value when reading from the data source. For example, the row has just been created, the default value of the column cannot be used, and no new value has been specified.
adFieldPermissionDenied 9 Indicates that the field cannot be modified because it is defined as read-only.
adFieldIntegrityViolation 10 Indicates that the field cannot be modified because it is a calculated or derived item.
adFieldSchemaViolation 11 Indicates that the value violates the data source schema restrictions.
adFieldBadStatus 12 Indicates that an invalid status value was sent from ADO to the OLE DB provider. The cause may be an OLE DB 1.0 or 1.1 provider, or an inappropriate combination of Value and Status.
adFieldDefault 13 Indicates that the default value of the field was used when setting the data.
adFieldIgnore 15 Indicates that the field is skipped when setting the data value in the source. The provider has not set any value.
adFieldDoesNotExist 16 Indicates that the specified field does not exist.
adFieldInvalidURL 17 Indicates that the data source URL contains invalid characters.
adFieldResourceLocked 18 Indicates that the provider cannot perform the operation because the data source is locked by one or more other applications or processes.
adFieldResourceExists 19 Indicates that the provider cannot perform the operation because the object already exists at the target URL and cannot be overwritten.
adFieldCannotComplete 20 Indicates that the server specified by the Source URL cannot complete the operation.
adFieldVolumeNotFound 21 Indicates that the provider cannot locate the storage amount indicated by the URL.
adFieldOutOfSpace 22 Indicates that the provider cannot obtain enough storage space to complete the move or copy operation.
adFieldCannotDeleteSource 23 Indicates that in the move operation, the tree or subtree is moved to a new location, but the source cannot be deleted.
adFieldReadOnly 24 Indicates that the field in the data source is defined as read-only.
adFieldResourceOutOfScope 25 Indicates that the source or target URL is out of the scope of the current record.
adFieldAlreadyExists 26 Indicates that the specified field already exists.
adFieldPendingInsert 0x10000 The Append operation indicates that the status needs to be set. The Field is marked as added to the Fields collection after calling the Update method.
adFieldPendingDelete 0x20000 Indicates that the Delete operation requires the status to be set. The field is marked to be removed from the Fields collection after calling the Update method.
adFieldPendingChange 0x40000 Indicates that the field has been deleted and then re-added (possibly with a different data type), or indicates that the value of a field previously with adFieldOK status has been changed. The final format of the field will be modified in the Fields collection after calling the Update method.
adFieldPendingUnknown 0x80000 Indicates that the provider cannot determine which operation caused the need to set the status.
adFieldPendingUnknownDelete 0x100000 Indicates that the provider cannot determine which operation caused the need to set the field status, and after calling the Update method, the field will be removed from the Fields collection.