Subject | RE: [IBO] exception handling and Connection.OnError |
---|---|
Author | Jason Wharton |
Post date | 2007-01-23T18:27:21Z |
> Lets say i have the following code:You can get the errcode from the exception itself right inside of your
>
> StoredProcedure.SQL.Clear;
> StoredProcedure.StoredProcName := 'MY_SP';
> .....
> TheTransaction.StartTransaction;
> try
> StoredProcedure.ExecProc;
> TheTransaction.Commit;
> except
> on E: Exception do
> TheTransaction.Rollback;
> end;
>
> Is there a way to get to IB_Connection.OnError event handler in case
> of network failre, despite of this try..except block?
exception handling code.
on E: IB_ISCError do
if Connection.WasConnLost( E.errcode )
OR, if using TDataset based components:
on E: IBOISCError do
if Connection.WasConnLost( E.errcode )
Please double-check my spelling.
Jason