Hi,
I have a question, I have a master/detail paradox table, when I delete the
master record it also deletes the detail records in the before delete event.
So far so good, but
If the master record was active then it gives me the error
master/key deleted.
I try to trap this error but it won't work..
Any suggestions?
Thanks in advange
Here is my code to trap the error while I have the constant eKeyOrrecDeleted
= 8708 just above the implementation section
procedure TDataMod.TblStaffDeleteError(DataSet: TDataSet;
E: EDatabaseError; var Action: TDataAction);
begin
if (E is EDBEngineError) then
if (E as EDBEngineError).Errors[0].Errorcode = eKeyOrrecDeleted then
begin
MessageDlg('The records are deleted succesfully.',
mtInformation, [mbOK], 0);
Abort;
end;
end;