This property indicates one or more characteristics of a Field object. This property is read-only.
var = field.Attribute
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.
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
Dim rs, n
Set rs = CreateObject ("adoce.recordset")
rs.Open "table1"
For n = 0 to rs.Fields.Count -1
MsgBox rs.Fields(n).Attributes
Next