Page 1 of 1
Stupid Question - Raising errors from Delphi 5.0
Posted: 09.04.2006, 00:04
by mparak
Dear friends,
Unless I stick all database (Zeos - MySQL) activity between the following error trap, I get no feedback for SQL errors. Clearly I need to change some setting in Delphi to be more strict with errors.
Try
//
// Database activity here
//
Except
on e:Exception do ShowMessage(e.message);
End;
Any ideas.
MParak
Posted: 09.04.2006, 12:38
by mdaems
Hi mparak.
Is it just while debugging that you want the debugger to stop when an exception is raised?(~debugger doesn't stop) Or does none of the bad queries show a message?(~CheckMySQLError doesn't catch the error in ZdbcMysqlUtils) Did you try to log all query traffic by using a zsqlmonitor?
Mark
Posted: 09.04.2006, 17:56
by mparak
Hi mdeams,
In answer to your question, I need help at run time, not in debug mode.
I get the impression from your reply that the ZsqlMonitor is the answer, but have no clue how this component works. I will scratch around and see if I can figure out how to use this.
Will let you know in this thread how it goes.
Warmest regards
M.
Posted: 09.04.2006, 18:55
by matsgefvert
Well, we use Zeoslib in Delphi 5.0 and I can guarantee that invalid SQL statements or other database-related errors indeed raises exceptions correctly.
I think there must be some other error in your program. Do have any empty "try / except end;" somewhere? Or do you trap Application.OnException and suppress it there?
ZSqlMonitor logs all queries executed, plain and simple. It is not needed to handle exceptions.
By the way, there are no settings to make Delphi more or less strict with exceptions.
/ Matt