Attributes Property

        Applies To

Sets or returns a value that indicates one or more characteristics of a CdbField, CdbRelation, or CdbTableDef object.

Syntax

VOIDSetAttributes(LONG lValue);

LONGGetAttributes(VOID);

Parameters

Type Argument Description
LONG lValue A Long with one or more of the values listed in Remarks. The default value is 0.

Remarks

On a CdbField object, the Attributes property specifies characteristics of the object and can be a combination of these constants.

Constant Description
dbAutoIncrField The field value for new records is automatically incremented to a unique Long integer that can't be changed (in a Microsoft Jet workspace, supported only for Microsoft Jet database(.mdb) tables).
dbDescending The field is sorted in descending (Z to A or 100 to 0) order; this option applies only to a CdbField object in a Fields collection of an CdbIndex object. If you omit this constant, the field is sorted in ascending (A to Z or 0 to 100) order. This is the default value for CdbIndex and CdbTableDef fields (Microsoft Jet workspaces only).
dbFixedField The field size is fixed (default for Numeric fields).
dbHyperlinkField The field contains hyperlink information (Memo fields only).
dbSystemField The field stores replication information for replicas; you can't delete this type of field (Microsoft Jet workspaces only).
dbUpdatableField The field value can be changed.
dbVariableField The field size is variable (Text fields only).

On a CdbRelation object, the property specifies characteristics of the relationship represented by the CdbRelation object and can be a combination of these constants.

Constant Description
dbRelationUnique The relationship is one-to-one.
dbRelationDontEnforce The relationship isn't enforced (no referential integrity).
dbRelationInherited The relationship exists in a non-current database that contains the two linked tables.
dbRelationUpdateCascade Updates will cascade.
dbRelationDeleteCascade Deletions will cascade.

Note If you set the CdbRelation object's Attributes property to activate cascading operations, the Microsoft Jet database engine automatically updates or deletes records in one or more other tables when changes occur in related primary tables.

For example, suppose you establish a cascading delete relationship between a Customers table and an Orders table. When you delete records from the Customers table, records in the Orders table related to that customer are also deleted. In addition, if you establish cascading delete relationships between the Orders table and other tables, records from those tables are automatically deleted when you delete records from the Customers table.

On a CdbTableDef object, the property specifies characteristics of the table represented by the CdbTableDef object and can be a combination of these constants.

Constant Description
dbAttachExclusive For databases that use the Microsoft Jet database engine, the table is a linked table opened for exclusive use. You can set this constant on an appended CdbTableDef object for a local table, but not on a remote table.
dbAttachSavePWD For databases that use the Microsoft Jet database engine, the user ID and password for the remotely linked table are saved with the connection information. You can set this constant on an appended CdbTableDef object for a remote table, but not on a local table.
dbSystemObject The table is a system table provided by the Microsoft Jet database engine. You can set this constant on an appended CdbTableDef object.
dbHiddenObject The table is a hidden table provided by the Microsoft Jet database engine. You can set this constant on an appended CdbTableDef object.
dbAttachedTable The table is a linked table from a non-ODBC data source such as a Microsoft Jet or Paradox database (read-only).
dbAttachedODBC The table is a linked table from an ODBC data source, such as Microsoft SQL Server (read-only).

For an object not yet appended to a collection, this property is read/write.

For an appended CdbField object, the availability of the Attributes property depends on the object that contains the Fields collection.

If the CdbField object belongs to an Then Attributes is
CdbIndex object Read/write until the CdbTableDef object that the CdbIndex object is appended to is appended to a CdbDatabase object; then the property is read-only.
CdbQueryDef object Read-only
CdbRecordset object Read-only
CdbRelation object Not supported
CdbTableDef object Read/write

For an appended CdbRelation object, the Attributes property setting is read-only.

For an appended CdbTableDef object, the property is read/write, although you can't set all of the constants if the object is appended, as noted in Settings and Return Values.

When you set multiple attributes, you can combine them by summing the appropriate constants. Any invalid values are ignored without producing an error.