Board index » delphi » Help:Record/Key Deleted message and Error message Numbers

Help:Record/Key Deleted message and Error message Numbers

Hello
I am rather new to programming and  have a Delphi 3 application with a
Master/Detail Table relationship. In the Master only one field is keyed and
in the Detail two fields are keyed. No Autoincrement fields are used. When I
try to edit one of the Keyed fields I keep getting (oh Boy am I tired of it)
the Record/Key Deleted message. Have been trying to trap the error but am
not succeding (maybe I should look for another occupation instead?).  The
same application written in Delphi 1 runs just fine (urrgh).
Would be very thankful if somebody out there has any ideas on how to solve
this problem.
Also does anybody know if there is a list of all DatabaseEngine errors
containing their appropriate numbers - can't make head or tail of
DBIErrs.Int and IDAPI.h......... how do I know the constant for the base
category???

Please forgive my questions if they are silly - but answer them anyway if
you can.

Lucien

 

Re:Help:Record/Key Deleted message and Error message Numbers


When I try to edit one of the Keyed fields in the Detail Table that is.

Lucien

Re:Help:Record/Key Deleted message and Error message Numbers


Quote
> I am rather new to programming and  have a Delphi 3 application with a
> Master/Detail Table relationship. In the Master only one field is keyed and
> in the Detail two fields are keyed. No Autoincrement fields are used. When I
> try to edit one of the Keyed fields I keep getting (oh Boy am I tired of it)
> the Record/Key Deleted message. Have been trying to trap the error but am
> not succeding (maybe I should look for another occupation instead?).  The
> same application written in Delphi 1 runs just fine (urrgh).
> Would be very thankful if somebody out there has any ideas on how to solve
> this problem.

The fields you are changing which are causing the problem are causing
you records to pass out of view of the BDE.  Normally this is because
(as you have pointed out) of autoincrement fields.  Is there something
special about the fields (eg are you using a filter, are they not all of
the keys in the relationship?)

How does delphi know about your relationship?  Are we talking about two
ttables with a MasterSource style relationship?  I find it hard to
believe that something this simple is causing the BDE problems.

The simple solution would be to not show the keyed field that is common
to both.  If the user is too change this field, then you will need to do
a DisableControls, allow them to change the field, do a Refresh, and
then do an EnableControls.  This sort of operation might be described as
a 'move'.

Oliver
oli...@zip.com.au
Sashalom Pty Ltd
Ph: +61-2-9283-1377 (w) 9675-1769 (h) 0411 754 414 (mob)

Re:Help:Record/Key Deleted message and Error message Numbers


Thanks Oliver

Have done a disable/refresh/enable and it works fine now.

Will certainly post more questions, knowing me:-)

Actually - assume we have a MasterTable and a DetailTable. In the
MasterTable are say Customers, in the DetailTable Orders. The MasterTable
has only one Keyed Field, say Customer Number, and the DetailTable has two
CustomerNumber and InvoiceNumber or DateOfPurchase. Assuming that there are
entries in the DetailTable, after a while the enduser discovers that the
wrong CustomerNumber
has been used for a while. If the CustomerNumber is edited in the
MasterTable the Details have nowhere to belong to. My question is how do I
Update all CustomerNumbers in the DetailTable as they are edited in the
MasterTable?

Well, that's all (I hope)

Thanks again
Lucien

Other Threads