Page 1 of 1

Why cant I catch exception?

Posted: Tue 03 Apr 2007 15:31
by mikrodidakt
try
{
database->MyScript->Execute();
}
catch (EMyError &e)
{
ShowMessage("cuaght exception");
}

the database is a borland module class that I have created to place all the components in and the MySQLScript is a TMySQLScript class. In the debugg mode I can se that my application is throwing a exception class EMySqlException but if I try to us that exception class i get a compiler error "missing catch statment".
The MyDAC version is old the version is 4.00.0.2 and uppgrade is not a option right now.

I can't even catch the exception if i use catch(...) and that should catch
every exception that is thrown in the try catch statment, right?

when I run this code the ShowMessage is never executed but another window popup with the error "#42000ALTER command denied to user 'mandoadmin'@'localhost' for table 'results'".
It's like the exception is caught by something else before it can be caught
by my catch statment what is it that I am doing wrong?

Posted: Wed 04 Apr 2007 09:08
by Antaeus
To catch exceptions raised by TMyScript when executing, you should add a handler to the OnError event of the TMyScript object.