Question: Can you help me with a coding example showing how to program the handle of the database errors. Until now I always used "on E: EFIBError do ..." and do not know how I can program this in FIBPlus.
Answer: You can use both - standard exceptions (EDatabaseError) and specific FIBPlus exceptions. For example:
try something except on E: EFIBError do ... end
FIBPlus exceptions are described in fib.pas:
For more details about this please read an article "FIBPlus: handling database errors"
EFIBError = class(EDatabaseError) private FSQLCode: Long; FIBErrorCode: Long; FSQLMessage :string; FIBMessage :string; SenderObj :TObject; public constructor Create(ASQLCode: Long; const aMsg: String;Sender:TObject); constructor CreateEx(ASQLCode: Long; const IBMsg,SQLMsg: String;Sender:TObject); property SQLCode : Long read FSQLCode ; property IBErrorCode: Long read FIBErrorCode ; property SQLMessage :string read FSQLMessage; property IBMessage :string read FIBMessage; end; EFIBInterBaseError = class(EFIBError); EFIBClientError = class(EFIBError);
FIBPlus has taken the headache out of this project. When I got the current contract, FIBPlus was included on the work computer from the client. I quickly found it easier to use and more powerful than any other Firebird component suite I had tested. When I ran into a problem setting up a persistent calculated field, the tech support people saved the day. I would also add that I tested Zeos, IBX, DBGo, UIB, and other FBconnectors. FIBPlus outperformed all of them, and FIBPlus was run on an older machine than the others were. That was most impressive.>>