See Also
Applies To
Field object, TableDef object
Description
Indicates one or more characteristics of a Field or TableDef. Not available at design time; read-only when the object is a member of a collection. Read/write only in the Professional Edition with a new object not yet appended to a collection.
Syntax
{ field | tabledef }.Attributes [ = numericexpression ]
Setting
For a Field object, the Attributes property setting can be any combination of the following:
Constant Value Description
DB_FIXEDFIELD 1 (Default for numeric) Value in the Field is fixed-length.
DB_AUTOINCRFIELD 16 Value for new records is automatically incremented by the database. Valid only on fields of Long data type.
DB_UPDATABLEFIELD 32 Value in the Field can be changed.
For a TableDef object, the Attributes property setting can be any combination of the following:
Constant Value (Hex) Description
DB_ATTACHEXCLUSIVE &H00010000 For Microsoft Access databases, indicates the table is an attached table opened for exclusive use.
DB_ATTACHSAVEPWD &H00020000 For Microsoft Access databases, indicates the user ID and password for the source table should be saved with the linking information.
DB_SYSTEMOBJECT &H80000002 Indicates the table is a system table.
DB_ATTACHEDTABLE &H40000000 Indicates the table is an attached table from a non-ODBC database, such as Microsoft Access or Paradox.
DB_ATTACHEDODBC &H20000000 Indicates the table is an attached table from an ODBC database, such as SQL Server or Oracle.
Remarks
The field part can be a member of a Fields collection of the Recordset property of a data control, and the tabledef part can be a member of the TableDefs collection of the Database property of a data control. In the Professional Edition, they can also be object variables identifying Field or TableDef objects, respectively.
When reading this property, use the And operator to test for a specific Attribute. For example, to determine whether a Field is fixed-length, you could use this code:
If Data1.Recordset.Fields("PubID").Attributes And DB_FIELDFIXED Then...
In the Professional Edition, you can set this property only on a New TableDef object, and you can use only DB_ATTACHEXCLUSIVE and DB_ATTACHSAVEPWD. To set both values, you can combine them by adding the values together. Any other values are ignored without error.
Data Type
Long