Unique Property

See Also    Example    Applies To

Sets or returns a value that indicates whether an CdbIndex object represents a unique (key) index for a table (Microsoft Jet workspaces only).

Syntax

VOIDSetUnique(BOOL bFlag );

BOOLGetUnique(VOID);

Parameters

Type Argument Description
BOOL bFlag TRUE if the CdbIndex object represents a unique index.

Remarks

For a CdbIndex object, this property setting is read/write until the object is appended to a collection, after which it's read-only.

A unique index consists of one or more fields that logically arrange all records in a table in a unique, predefined order. If the index consists of one field, values in that field must be unique for the entire table. If the index consists of more than one field, each field can contain duplicate values, but each combination of values from all the indexed fields must be unique.

If both the Unique and Primary properties of a CdbIndex object are set to True, the index is unique and primary: It uniquely identifies all records in the table in a predefined, logical order. If the Primary property is set to False, the index is a secondary index. Secondary indexes (both key and nonkey) logically arrange records in a predefined order without serving as an identifier for records in the table.

Notes