Thanks LacaK. Silly me. I had not changed the "on E: EDatabaseError do" part of the my code.
Many thanks for the help.
Just to add I got it to work using :
except
on E: EIBDatabaseError do
but not with:
except
on E: ESQLDatabaseError do
ShowMessageFmt('ErrorCode: %d; Messsge: %s', [E.ErrorCode, E.Message]);
with the latter I get:
unit1.pas(89,15) Error: Identifier not found "ESQLDatabaseError"
unit1.pas(89,33) Error: class type expected, but got "<erroneous type>"