How to catch a exception from TMyScript??

How to catch a exception from TMyScript??

Postby 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 :?: :?: :?:
mikrodidakt
 
Posts: 20
Joined: Fri 05 Aug 2005 12:20
Location: Sweden

Postby Ikar » Thu 25 Aug 2005 12:42

Use TMyScript.OnError event
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56


Return to MySQL Data Access Components