EMyError in dbxmda

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
Guest

EMyError in dbxmda

Post by Guest » Mon 21 Mar 2005 01:30

Hi

Why dbxmda sometimes fired EMyError exception when i execute wrong SQL statement ? i think dbxmda should throw EDatabaseError which i think is dbExpress standard .
Because if EMyError used , i have to include MyDac header files . Thats where EMyError came from (Myclasses.hpp) , right??

I would like to see this in next version ..:)

Thanks in advance

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

Post by Ikar » Mon 21 Mar 2005 08:06

We couldn't reproduce the problem.
Please send us complete small sample to demonstrate it and include script to create server objects.

Guest

Post by Guest » Tue 22 Mar 2005 03:38

TSQLConnection * con = new TSQLConnection(Application);
TSQLDataSet * ds = new TSQLDataSet(Application);

con->ConnectionName = "MySQL (Core Lab)";
con->DriverName = "MySQL (Core Lab)";
con->GetDriverFunc = "getSQLDriverMySQL";

con->Params->Clear();
con->Params->Add("DriverName=MySQL (Core Lab)");
con->Params->Add("HostName=" + String(config.db_server));
con->Params->Add("Database=" + String(config.db_name));
con->Params->Add("User_Name=" + String(config.db_user));
con->Params->Add("Password=" + String(config.db_password));
con->Params->Add("BlobSize=-1");

con->LibraryName = "libsqlmda.so.2.50";
con->VendorLib = "libmysql.so";

con->Open();

} catch (EDatabaseError &E)
{
String Error = "Error connect to db "+E.Message;
Debug(Error,MAJOR_ERROR_LOG);
return (0);
}


if (con->Connected)
{
String sql = "SELECT * FROM aconfig";

try {

ds->CommandText = sql;

try {

ds->Close();

ds->Open();

} catch (EDatabaseError &E)
{
Debug(E.Message, MAJOR_ERROR_LOG);
}

}

yes..exception arises when i execute ds->Open() !! actually table aconfig doest exist. The point is..when wrong query entered , Exception EMyError was thrown . That's why i cant catch it ..

thanks in advance

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

Post by Ikar » Fri 25 Mar 2005 16:26

During the experiments we could find out that it is an error of Kylix IDE - it represents class of the exception in the driver but not an exception at the application.

You can check it if try this code:

Code: Select all

try
  Query.Open;
except
  on e: exception do begin
    Caption := e.ClassName;
    raise;
  end;
end;

Post Reply