Delphi / Object Pascal · Database exception

BDE Error 9729 ($2601) - Key Violation

What does BDE Error 9729 ($2601) - Key Violation mean in Delphi / Object Pascal?

The SQL-link and referential-integrity category's key violation error, distinct from the local-table KEYVIOL code, raised when a database-level unique constraint or primary key is violated by an insert or update.

BDE Error 9729 ($2601) - Key ViolationDelphi (VCL) · Delphi (BDE)

Condition

The SQL-link and referential-integrity category's key violation error, distinct from the local-table KEYVIOL code, raised when a database-level unique constraint or primary key is violated by an insert or update.

Fix

Validate uniqueness in the application before submitting the write when possible, and catch this code specifically to show a friendly duplicate-value message instead of the generic BDE error dialog.

Related database exception