Subject Re: [IBO] IBquery - OnError raises Exception, although RaiseException:=False
Author Helen Borrie
At 10:55 PM 13/03/2006, you wrote:
>I'm checking for duplicate entries during the post within the query's onerror
>procedure TLager.IB_Query_BestellNrError(Sender: TObject;
> const ERRCODE: Integer; ErrorMessage, ErrorCodes: TStringList;
> const SQLCODE: Integer; SQLMessage, SQL: TStringList;
> var RaiseException: Boolean);
> inherited;
> if Pos('duplicate value',Errormessage.Text)>0 then
> Begin
> if Pos('IX_ZUSBESTELLNR',errormessage.text)>0 then
> Begin
> RaiseException:=False;
> DBGrid_BestellNr.SetFocus;
> BvOMessageBox('Die zusätzliche Bestell-Nr., die Sie eingegeben
>haben, gibt es bereits. Bitte prüfen und korrigieren Sie das.', 'Doppelte
>Zusatz-Bestell-Nr.', MB_OK);
> End;
> End;
>This is detecting the duplicate insertion and showing the messagebox. But
>after that I got an exception EIB_DatasetError (Record not inserted),
>although RaiseException is set to false.
>Did I make a mistake here or how can i prevent the exception message to
>the user?

Are you testing this by running it in the
IDE? Run the executable independently and check
whether you still see the internal error output. I think you will not. :-)