Board index » delphi » EDatabaseError Exception

EDatabaseError Exception

When setting the Field's Property "REQUIRED" from False to True, then while
posting a record with the particular field empty, an EDatabaseError
exception is raised with the message 'Field 'FIELDNAME' must have a value'.
How can I Override this default behavior and present my own message or do
some other things while the exception is raised?

Dimitris Milonas.

 

Re:EDatabaseError Exception


have you looked in the use of "Try, except, finally" ?

Dimitris Milonas <qms...@otenet.gr> wrote in article
<01bdb03d$1018db40$597ca7c3@hobbit>...

Quote
> When setting the Field's Property "REQUIRED" from False to True, then
while
> posting a record with the particular field empty, an EDatabaseError
> exception is raised with the message 'Field 'FIELDNAME' must have a
value'.
> How can I Override this default behavior and present my own message or do
> some other things while the exception is raised?

> Dimitris Milonas.

Re:EDatabaseError Exception


I forgot to mention that I also use a DbNavigator to perform the post. So
when pressing the post button there is no way to use a try...except. Also,
for what I am aware, The EDatabaseError class, contains only the error
message, so if the EDatabaseError has occure for another reason there is no
way to identify the error.

Best Regards
Dimitris Milonas

Maynard Philbrook (Jamie) wrote

Quote
> have you looked in the use of "Try, except, finally" ?

Re:EDatabaseError Exception


Check if the Field is empty before you post it and then trow your own
message. Then you prevent the database to throw their message. Do you know
abot preconditions and postconditions "Bertrand Meyer Object oriented
software construction". If you know about that, then you know you have to
check for errors before calling a method. Since post probably is done by
using Windows messages you dont know when it is received.

Lars Rosenberg
Rosoft Engineering
Karlstad SWEDEN

Quote
Dimitris Milonas wrote in message <01bdb09a$9641f8c0$6a7ca7c3@hobbit>...
>I forgot to mention that I also use a DbNavigator to perform the post. So
>when pressing the post button there is no way to use a try...except. Also,
>for what I am aware, The EDatabaseError class, contains only the error
>message, so if the EDatabaseError has occure for another reason there is no
>way to identify the error.

>Best Regards
>Dimitris Milonas

>Maynard Philbrook (Jamie) wrote

>> have you looked in the use of "Try, except, finally" ?

Other Threads