How to handle EZSQLExceptions

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
boost
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 29.10.2007, 15:19
Location: New Earth, Degova System

How to handle EZSQLExceptions

Post by boost »

Hi all!

first of all let me say a huge Thank You to all developers of ZeosLib!!!

I'm coding a database application after a few years without writing a single line of code, and couldn't belive my eyes when found ZeosLib!

Is is absolutely amazing, native acces to SQL engines... for FREE!!!

thanks a lot guys this is really exciting!

ok, let me introduce my problem :)

I would like to know how can one handle EZSQLExceptions elegantly. I mean, I wouldn't like to show the user an english error message (users will be spanish people), and also, I would like to give a more detailed explanation of what is going wrong.

I guess one needs to work with ErrorCode and StatusCode properties, but how can one know what those numbers mean?

I'm working with Delphi 7 + MySQL 5 + ZeosLib 6.6.1-beta.

thanks,

Juan Ortanobas
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi Juan,

Meanings of the codes sent by mysql are explained in Appendix B of the mysql documentation.
The message that goes with the code is also available in your exception. (see the CheckMySQLError procedure in zdbcmysqlutils.pas)

I hope you find out how to get zeoslib messages in spanish? Edit zeos.inc : {$DEFINE SPANISH} instead of {$DEFINE ENGLISH} Messages come from Messages.pas unit.

Mark
boost
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 29.10.2007, 15:19
Location: New Earth, Degova System

Post by boost »

Okay, thanks a lot for the reply Mark!

Juan Ortanobas
Post Reply