Subject Unexpected Record/Key Deleted Message
Author rstitt@kcp.com
I am having a bit of a (very weird) problem, that appears to be related to
a primary index.

Namely, I get a "Record/Key Deleted" error (BDE code 8708 [$22][$4]) when I
try to go into "edit" mode on certain records in the table (and they REALLY
DO exist!!).

I have used "gbak" to export & re-import the file, I have removed all
constraints (other than the primary key), dropped all non-key columns,
moved from a very old version of IB to the newer one (likewise, the Delphi
6 version of BDE as well), etc. I dropped all other tables and all
non-essential rows from this table.

The only thing that seems to allow things to work is either:

1) Issuing a "update ... set ... where ..." statement to update the
"Assoc_Id" column
2) Dropping/rebuilding the index

What I need to know is: how & why did this index get messed up? What is
wrong (perhaps with BDE??) that made this surface? Why didn't re-creating
the db fix it??

Thanks,

...Rob Stitt

Here's the "gbak" output from dumping the database, followed by the
database's metadata--nothing seemed unusual:

D:\IB Database>"c:\Program Files\Borland\InterBase\bin\gbak.exe" -user
sysdba -pas xxxxxx -b -v test.gdb test-g2.dat
gbak: readied database test.gdb for backup
gbak: creating file test-g2.dat
gbak: starting transaction
gbak: database test.gdb has a page size of 1024 bytes.
gbak: writing domains
gbak: writing domain RDB$136
gbak: writing domain RDB$137
gbak: writing domain RDB$138
gbak: writing domain RDB$139
gbak: writing shadow files
gbak: writing tables
gbak: writing table USERID_TBL
gbak: writing column ASSOC_ID
gbak: writing column USERID_QUALIFIER
gbak: writing column USERID
gbak: writing column SYSTEM_ID
gbak: writing functions
gbak: writing types
gbak: writing filters
gbak: writing id generators
gbak: writing generator PASSWORD_NUMBER value 39560
gbak: writing generator DIRECTORY_NUMBER value 9
gbak: writing stored procedures
gbak: writing exceptions
gbak: writing Character Sets
gbak: writing Collations
gbak: writing index RDB$PRIMARY11
gbak: writing data for table USERID_TBL
gbak: 13 records written
gbak: writing triggers
gbak: writing trigger messages
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user PUBLIC
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing privilege for user SYSDBA
gbak: writing table constraints
gbak: writing constraint INTEG_42
gbak: writing constraint INTEG_43
gbak: writing constraint INTEG_44
gbak: writing constraint INTEG_45
gbak: writing constraint UID_PKEY
gbak: writing referential constraints
gbak: writing check constraints
gbak: writing SQL roles
gbak: closing file, committing, and finishing. 2560 bytes written
===============
/* Table: USERID_TBL, Owner: SYSDBA */

CREATE TABLE USERID_TBL
(
ASSOC_ID VARCHAR(10) NOT NULL,
SYSTEM_ID VARCHAR(15) NOT NULL,
USERID VARCHAR(20) NOT NULL,
USERID_QUALIFIER VARCHAR(20) NOT NULL,
CONSTRAINT UID_PKEY PRIMARY KEY (ASSOC_ID, SYSTEM_ID, USERID,
USERID_QUALIFIER)
);