AdsDisableAutoIncEnforcement

Advantage Client Engine

Disables the enforcement of the read/only status of auto-increment values.

Syntax

UNSIGNED32 AdsDisableAutoIncEnforcement( ADSHANDLE hConnect );

Parameters

hConnect (I)

Valid connection handle.

Remarks

AdsDisableAutoIncEnforcement disables the read/only status of auto-increment values in tables opened on the given connection. By default, auto-increment values are generated and maintained by Advantage. After this API is called, an application can write to auto-increment values either through direct API calls such as AdsSetLong or through SQL INSERT and UPDATE statements. No verification of the uniqueness of auto-increment values is performed by Advantage when this API is used. Therefore, it is possible to write duplicate auto-increment values to a table.

When auto-increment enforcement is disabled, Advantage will monitor the auto-increment values that are stored in a table and will ensure that future auto-increment values generated by Advantage are greater than any values written manually by an application. Suppose, for example, an application creates a new table with an auto-increment field, disables auto-increment enforcement, and writes the value 100 to the auto-increment field. When the next record is appended (either through the API AdsAppendRecord or through an SQL INSERT statement), Advantage will generate a new auto-increment value of 101.

An application should call AdsEnableAutoIncEnforcement to restore the read/only status of auto-increment fields after using this API.

See Also

AdsEnableAutoIncEnforcement

AdsDisableUniqueEnforcement

AdsEnableUniqueEnforcement

AdsDisableRI

AdsEnableRI