This property returns a value that indicates one or more characteristics of a Field object.
This property is read-only.
Syntax
var = field.Attributes
Return Values
For a Field object, the value specifies characteristics of the field and can be a sum of one or more of the values described in the following table.
Constant | Value | Description |
AdFldMayDefer | 2 | Indicates that the field is deferred; that is, the field values are not retrieved from the data source with the entire record, but only when you explicitly access the values. |
AdFldUpdatable | 4 | Indicates that you can write to the field. |
AdFldUnknownUpdatable | 8 | Indicates that the provider cannot determine if you can write to the field. |
AdFldFixed | 16 | Indicates that the field contains fixed-length data. This is set for all data types except adVarWChar, adLongVarWChar, adVarBinary, and adLongVarbinary. |
AdFldIsNullable | 32 | Indicates that the field accepts NULL values. |
AdFldMayBeNull | 64 | Indicates that you can read NULL values from the field. |
AdFldLong | 128 | Indicates that the field is a long binary field or that you can use the AppendChunk and GetChunk methods. |
AdFldRowID | 256 | Indicates that the field contains a record identifier, such as record number, unique identifier, and so on. |
ADOCE never returns the values adFldRowVersion and adFldCacheDeferred.
Example
The following code example sets the constants for the Attributes property.
Const adFldMayDefer = 2
Const adFldUpdatable = 4
Const adFldUnknownUpdatable = 8
Const adFldFixed = 16
Const adFldIsNullable = 32
Const adFldMayBeNull = 64
Const adFldLong = 128
Const adFldRowID = 256
The following code example shows how to display field attributes using the Attributes property.
Dim rs, n
Set rs = CreateObject ("adoce.recordset")
rs.Open "myTable"
For n = 0 to rs.Fields.Count -1
MsgBox rs.Fields(n).Attributes
Next