You need an exception handler around the code in question.

Have a read in the help about exceptions, but something like this should 
suffice :


line of code...
line of code...
line of code...
TRY
  line(S) of code that causes the violation
EXCEPT
  On e:exception do
    Showmessage('Whoops, error '+e.message);
END



----- Original Message ----- 
From: "Sheety, Hanna (FAORNE)" <[EMAIL PROTECTED]>
To: <delphi-db@elists.org>
Sent: Sunday, March 25, 2007 7:28 AM
Subject: Handling BDE Keyviolations in Delphi forms


> Hi there,
>
>
>
> A beginner's question!  It's about handling key violation messages in 
> Delphi
> forms.  I have a form based on a paradox table.  When data that violates 
> the
> referential integrity key is entered the form collapses.  What should I do 
> to
> trap the error message and deal with it?
>
>
>
> Thank you
>
> Hanna
>
>
>
> _______________________________________________
> Delphi-DB mailing list
> Delphi-DB@elists.org
> http://www.elists.org/mailman/listinfo/delphi-db
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.17/732 - Release Date: 
> 24/03/2007 16:36
>
> 


_______________________________________________
Delphi-DB mailing list
Delphi-DB@elists.org
http://www.elists.org/mailman/listinfo/delphi-db

Reply via email to