Page 1 of 1
EMyError in dbxmda
Posted: Mon 21 Mar 2005 01:30
by Guest
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
Posted: Mon 21 Mar 2005 08:06
by Ikar
We couldn't reproduce the problem.
Please send us complete small sample to demonstrate it and include script to create server objects.
Posted: Tue 22 Mar 2005 03:38
by Guest
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
Posted: Fri 25 Mar 2005 16:26
by Ikar
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;