ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/local-employeedb/unit1.pas
(Generate patch)

Comparing ibx/trunk/examples/local-employeedb/unit1.pas (file contents):
Revision 208 by tony, Fri Feb 23 12:11:21 2018 UTC vs.
Revision 209 by tony, Wed Mar 14 12:48:51 2018 UTC

# Line 197 | Line 197 | type
197    end;
198  
199   var
200 <  Form1: TForm1;
200 >  Form1: TForm1;
201  
202   implementation
203  
204   {$R *.lfm}
205  
206 < uses IB, Unit2;
206 > uses IB, Unit2, FBMessages;
207  
208   const
209    sNoName = '<no name>';
210  
211 function ExtractDBException(msg: string): string;
212 var Lines: TStringList;
213 begin
214     Lines := TStringList.Create;
215     try
216       Lines.Text := msg;
217       if pos('exception',Lines[0]) = 1 then
218         Result := Lines[2]
219       else
220         Result := msg
221     finally
222       Lines.Free
223     end;
224 end;
225
211   { TForm1 }
212  
213   procedure TForm1.EmployeesSALARYGetText(Sender: TField; var aText: string;
# Line 527 | Line 512 | end;
512  
513   procedure TForm1.FormShow(Sender: TObject);
514   begin
515 +  {Set IB Exceptions to only show text message - omit SQLCode and Engine Code}
516 +  FirebirdAPI.GetStatus.SetIBDataBaseErrorMessages([ShowIBMessage]);
517 +  Application.ExceptionDialog := aedOkMessageBox;
518    try
519      IBDatabase1.Connected := true;
520    except On E:Exception do
# Line 561 | Line 549 | procedure TForm1.EmployeesPostError(Data
549   begin
550    if E is EIBError then
551     begin
552 <       MessageDlg(ExtractDBException(EIBError(E).message),mtError,[mbOK],0);
552 >       MessageDlg(EIBError(E).message,mtError,[mbOK],0);
553         DataSet.Cancel;
554         DataAction  := daAbort
555     end;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines