Stupid Question - Raising errors from Delphi 5.0

Forum related to the ZDBC API-Layer

Moderators: gto, cipto_kh, EgonHugeist

mparak
Senior Boarder
Senior Boarder
Posts: 81
Joined: 12.09.2005, 06:51
Location: Durban South Africa
Contact:

Stupid Question - Raising errors from Delphi 5.0

Postby mparak » 09.04.2006, 00:04

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

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

Postby mdaems » 09.04.2006, 12:38

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
Image

mparak
Senior Boarder
Senior Boarder
Posts: 81
Joined: 12.09.2005, 06:51
Location: Durban South Africa
Contact:

Postby mparak » 09.04.2006, 17:56

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.

matsgefvert
Junior Boarder
Junior Boarder
Posts: 38
Joined: 22.11.2005, 09:11
Location: Skövde, Sweden
Contact:

Postby matsgefvert » 09.04.2006, 18:55

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
Coffee clarifies the mind, improves morale, lifts the spirit and motivates and inspires to focused, productive work.


Return to “ZDBC (ZEOS Database Connectivity)”

Who is online

Users browsing this forum: No registered users and 1 guest