"Record/Key Deleted" BDE Error 
Author Message
 "Record/Key Deleted" BDE Error


Quote:
>>        Maybe this is a simple question, but it has me stumped.  I am
>>trying to use a TTable and add records to it programmatically.  The
>>table is a local interbase table with a "before insert" trigger
>>that generates a unique value for the key field ITEM_NUMBER.  The
>>delphi code looks something like:

>>        Table1.Append;
>>        { Add data }
>>        Table1.Post;

>>If all fields are added to the table in the default manner, an
>>exception occurs on the Post saying the ITEM_NUMBER (the key field)
>>must have a value.  If I remove the TField for ITEM_NUMBER or
>>change the "Required" property to False, I get an exception from
>>the BDE sayint "Record/Key Deleted."  Can anyone explain this?  Is
>>there a way around this to let delphi know that the ITEM_NUMBER
>>will be filled in by the server?
>I have this exact same problem, but have received no responses to two
>previous posts about it.  I don't believe the problem is caused by the
>key field being filled in by the server.  I have found that if I remove
>all defaults in the table definition (for example, instead of saying
>"TodaysDate Date Default 'Now'" make it "TodaysDate Date") I don't get
>the "Record/Key Deleted" message.  Yet on other tables I can have all the
>defaults I want without receiving an error, even when filling in the key
>field with a trigger in the server.
>I hope hope someone has an answer to this problem.

My magic 8-ball [brain] is saying "reply hazy, try again" this morning, but I
believe that the (undocumented, of course) explanation for this message is
that when your BDE goes to the server expecting to be able to refer to the
record that it inserted, the server is saying that the record can't be found.  
The message suggests that perhaps someone else deleted it, but that is not the
only explanation.

If you inserted the record with a null value that the server is going to
assign, then the record that gets stored into the database is unpredictable.  
I believe that, after storing it, you need to "find" it again to re-establish
your cursor's position in the database.  Otherwise, your cursor is left
pointing at nowhere -- "record/key deleted."

.... GRR ... yet another demonstration of how important thorough documentation
is to customers!  Not having fast, reliable access to this sort of information
literally costs us MONEY, Borland!  This is an area where, unfortunately, you
need to take a lesson from your friends in Redmond.  Nearly every single
message in Access, for example, is scrupulously documented.

/mr/



Tue, 25 Aug 1998 03:00:00 GMT  
 "Record/Key Deleted" BDE Error


Quote:
> I have this exact same problem, but have received no responses to two
> previous posts about it.  I don't believe the problem is caused by the
> key field being filled in by the server.  I have found that if I remove
> all defaults in the table definition (for example, instead of saying
> "TodaysDate Date Default 'Now'" make it "TodaysDate Date") I don't get
> the "Record/Key Deleted" message.  Yet on other tables I can have all the
> defaults I want without receiving an error, even when filling in the key
> field with a trigger in the server.

> I hope hope someone has an answer to this problem.

> Rich

I just did what Rich did and got rid of all defaults.  Not as convenient
but it works for me.

Tom



Tue, 25 Aug 1998 03:00:00 GMT  
 "Record/Key Deleted" BDE Error
: Hello,

:       Maybe this is a simple question, but it has me stumped.  I am
: trying to use a TTable and add records to it programmatically.  The
: table is a local interbase table with a "before insert" trigger
: that generates a unique value for the key field ITEM_NUMBER.  The
: delphi code looks something like:

:       Table1.Append;
:       { Add data }
:       Table1.Post;

: If all fields are added to the table in the default manner, an
: exception occurs on the Post saying the ITEM_NUMBER (the key field)
: must have a value.  If I remove the TField for ITEM_NUMBER or
: change the "Required" property to False, I get an exception from
: the BDE sayint "Record/Key Deleted."  Can anyone explain this?  Is
: there a way around this to let Delphi know that the ITEM_NUMBER
: will be filled in by the server?

: Thanks in advance.

: --
: Jeff Ellis

I remember having a problem like that. It disappeared after I removed all
DEFAULT directives from my SQL definition file. It seems that the insertion of
default values changes the record in a way that makes the DBE think it is a
different record (that of course is my own amateur interpretation).
I even mailed to Steve Koterski but somehow he was unable to reproduce the
proble so he could not really help me.
If somebody knows how to make use of default values in Interbase, please let
us know!

Hope this helps,

                                                   Andy



Tue, 25 Aug 1998 03:00:00 GMT  
 "Record/Key Deleted" BDE Error
There have been a couple of items about this on delphi-talk.  We ran
into it using identity columns with MS SQLServer (sequence field as
primary key - filled in by the server).  The BDE basically checks to
make sure that what it sent to the server got there.  It is not smart
enough to know about things like sequence generators!  When it sees that
the key it sent is not still there it assumes that someone deleted it
while we were working with it (you get the same error if that's actually
what happens).  Tech support suggests a two step work around which
involves 1) Trapping and ignoring the error and 2) finding a way to get

which provides the number most recently gen'ed by this session).

I'm at home now but if you'd like more information and can't get it from
the SQL Links folks at Borland or the Delphi-talk archive
(http://www.qns.com/html/delphi - subject Record/Key deleted) drop me a

then.  Might help.

Scott McClure



Tue, 25 Aug 1998 03:00:00 GMT  
 "Record/Key Deleted" BDE Error
There have been a couple of items about this on delphi-talk.  We ran
into it using identity columns with MS SQLServer (sequence field as
primary key - filled in by the server).  The BDE basically checks to
make sure that what it sent to the server got there.  It is not smart
enough to know about things like sequence generators!  When it sees that
the key it sent is not still there it assumes that someone deleted it
while we were working with it (you get the same error if that's actually
what happens).  Tech support suggests a two step work around which
involves 1) Trapping and ignoring the error and 2) finding a way to get

which provides the number most recently gen'ed by this session).

I'm at home now but if you'd like more information and can't get it from
the SQL Links folks at Borland or the Delphi-talk archive
(http://www.qns.com/html/delphi - subject Record/Key deleted) drop me a

then.  Might help.

Scott McClure



Tue, 25 Aug 1998 03:00:00 GMT  
 "Record/Key Deleted" BDE Error

I have seen many cases where the this happens.  It might be the same -
(I am no database Guru - please bear with me)

With server auto increment fields, the BDE posts the record, the server
increments and it goes into the database just fine - THEN - before
anything else happens the BDE reads the record it just posted and
compares the two - and raises an exception if they don't match, or it
can't find the record it posted or something similar.  And this is the
case - the record as the BDE knew it, was not posted, the record with
the new field was...

So the error message is kind of bogus, and can be trapped and smothered.

So if your data is showing up the DB, this is most likly what is
happening.

Bill

Quote:


> : Hello,

> :       Maybe this is a simple question, but it has me stumped.  I am
> : trying to use a TTable and add records to it programmatically.  The
> : table is a local interbase table with a "before insert" trigger
> : that generates a unique value for the key field ITEM_NUMBER.  The
> : delphi code looks something like:

> :       Table1.Append;
> :       { Add data }
> :       Table1.Post;

> : If all fields are added to the table in the default manner, an
> : exception occurs on the Post saying the ITEM_NUMBER (the key field)
> : must have a value.  If I remove the TField for ITEM_NUMBER or
> : change the "Required" property to False, I get an exception from
> : the BDE sayint "Record/Key Deleted."  Can anyone explain this?  Is
> : there a way around this to let Delphi know that the ITEM_NUMBER
> : will be filled in by the server?

> : Thanks in advance.

> : --
> : Jeff Ellis

> I remember having a problem like that. It disappeared after I removed all
> DEFAULT directives from my SQL definition file. It seems that the insertion of
> default values changes the record in a way that makes the DBE think it is a
> different record (that of course is my own amateur interpretation).
> I even mailed to Steve Koterski but somehow he was unable to reproduce the
> proble so he could not really help me.
> If somebody knows how to make use of default values in Interbase, please let
> us know!

> Hope this helps,

>                                                    Andy



Sun, 30 Aug 1998 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. "Record/Key Deleted" BDE Error

2. Interbase error "record/Key deleted"

3. "Record/Key Deleted" Error

4. EDBEngineError..."Record/Key deleted"

5. TTable - "Record/Key deleted"

6. "Record/Key deleted"

7. Need help on "Record/Key deleted"

8. The keys "-"/"+"/"*"

9. HELP -- "Key group is locked" error

10. Error: "No current record"

11. Record/key Deleted. A BDE Error

12. BDE Error Record Key Deleted

 

 
Powered by phpBB® Forum Software