How to catch a exception from TMyScript??

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mikrodidakt
Posts: 20
Joined: Fri 05 Aug 2005 12:20
Location: Sweden

How to catch a exception from TMyScript??

Post by mikrodidakt » Thu 25 Aug 2005 11:12

Hi i cant catch exception

Code: Select all

  try
  {
    this->MyScript1->Execute();
    this->MyTable1->Close();
    this->MyTable1->TableName = "satietycurve";
    this->MyTable1->Open();
    this->MyTable1->Insert();
    this->MyTable1->FieldByName("SatietyXML")->AsString = XMLStr;
    this->MyTable1->Post();
    this->MyConnection1->Connect();
    XMLStr.Delete(1,XMLStr.Length());
  }
  catch(const EMyError &e)
  {
    ShowMessage(AnsiString("SQL error"));
  }
In MyScript1 I am selecting a database xmltest, witch dose't exist.
Whene the debugger has reached this->MyScript->Execute i get a error
but instead of jumping to the catch statment i get a error mesage witch I have't created. This happens also when I run the project outside of the IDE. I think that it is the TMyScript that is throughing the exception but why cant i catch it :?: :?: :?:

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 25 Aug 2005 12:42

Use TMyScript.OnError event

Post Reply