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; |
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 |
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; |