Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Key Violation Error

Status
Not open for further replies.

ameen

Programmer
Jun 24, 2001
32
IN
How to avoid seeing the EDBEngineError with message Key Violation.

Ameen
 
procedure TForm1.Table1PostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction);
begin
if EDBEngineError(E).Errors[0].ErrorCode = 9729 then
ShowMessage('Record!');
Action:= daAbort;
end;
 
If your table has key field, and you try to post a duplicate, you will get a key violation error S. van Els
SAvanEls@cq-link.sr
 
Thanks for the responses.
Yes, the error was due to duplicate posting of data to the key field.

Ameen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top