Need help on "Record/Key deleted"

Need help on "Record/Key deleted"

Post by Svyatoslav Danilo » Sun, 31 Dec 1899 09:00:00

I currently work with D1/Interbase. The problem nevertheless is common for
D1, D2 and D3. Just created a new database with a few tables in it. Have a
butchers at one of the tables and its indices.

create table COUNTRY
    COUNTRYNO                       INTEGER                not null,
    COUNTRYNAME                     CHAR(15)               not null,
    PREFIX                          CHAR(10)               not null,
    CONTINENT                       CHAR(2)               default 'Eu' not null
        constraint ck_country_continent check (CONTINENT in ('Eu','As','Af','Oc','NA','SA','An')),
    constraint pk_country primary key (COUNTRYNO)

create unique index COUNTRYNOX on COUNTRY (COUNTRYNO);

SET_COUNTRYNO trigger takes care of the primary key.

In my application I use StartTransaction, Commit and Rollback methods with
SQLPASSTHRU mode of the alias set to NOT SHARED. StartTransaction method is
triggered in OnShow event of the form and after each Commit and RollBack
in OnAfterCancel and OnAfterPost respectively.

Editing and deleting work just fine but when it comes to inserting a record
inevitably the above error msg appeares followed by "Key violation. Attempt
to store duplicate value in unique index COUNTRYNAMEX."

First I thought that the programme tries to insert a record twice. Then
I dropped both constraints and the indices leaving only primary key -
everything got back to normal.

I wander whats wrong with my table. ANy info on "Key deleted" message would
be greatly appreciated. Where can I find a description of such errors.

Many thanks,

Svyatoslav "Stan" Danilov


1. Q2: Need help on "Record/Key deleted" message.

#include <stddisclaimer.hi>

I would like to get info on the a/m message. Does anyone have a
comprehensive information on such errors?

I use D1, InterBase, Win95. In my application, each time I insert a
record into a table which has no IndexName or IndexFieldName set,
DBGrid shows something like this:

PrimaryField    JustAField
           1    Value         (1st row)
                Value         (2nd row)

Looks like the record is inserted twice - with Primary field value = 1
(2, 3, ...). Standard "BEFORE INSERT TRIGGER" takes care of the primary

When I call Refresh, DBGrid looks good, namely:

PrimaryField    JustAField
           1    Value        (1st row)

After a few manipulations I sooner or later get the message "Record/Key
deleted" followed by "Primary key violation".

When I set IndexName of IndexFileName to PrimaryField, DBGrid works
fine, but, still, after a series of Posts, Cancels and Deletes Delphi
shows the same error. The above message in both cases pops up only
after Insert (somewhere in between OnNewRecord and OnAfterInsert).

No problems with Paradox autoincrement fields, by the way.

I'm puzzled. Please help.

Yours Svyatoslav "Stan" Danilov

tel: (+7)-81850-35032
fax: (+7)-81850-30950

2. Linked Server Error 7399

3. EDBEngineError..."Record/Key deleted"

4. dbassist problems in Oracle 8.1.7 Linux

5. "Record/Key Deleted" Error

6. returning arrays in stored procedures

7. TTable - "Record/Key deleted"

8. Replication between SQL Server 7 and Access

9. "Record/Key deleted"

10. Interbase error "record/Key deleted"

11. "Record/Key Deleted" BDE Error

12. How to delete a record with the key which contains "%20"(space) in the

13. "Record/Key Deleted" BDE Error