 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Sugi Guest
|
Posted: Tue May 15, 2007 8:09 am Post subject: ADO VCL and MySQL 5 |
|
|
Hi all,
I am using ADO Query in BCB 6 to connect to MySql Server 5. Connection was made through MySql ODBC 3.51.
The command to execute Query looks like this :
double GetData(bool On)
{
AdoQ->Close();
AdoQ->SQL->Clear();
AdoQ->SQL->Add("Select sum(nml) as Nml from table1")
if(On == 1) AdoQ->SQL->Add("where is_plsh= 'T'");
else AdoQ->SQL->Add("where is_plsh<= '5'");
AdoQ->Open();
if(AdoQ->IsEmpty()) return 0;
else return Q->FieldByName("nml")->AsFloat;
}
OnValue = GetData(1);
OffValue = GetData(2);
The first execution GetData(1) return ok, but the second one return with error message 'Unspecified Error'.
Trying to call OnValue twice also produced the same error on the second call.
I tried to created another function GetData2() using new query, named AdoQ2, with the same codes as above except for where clause, not using if, but simply use where is_pblsh <= '5'. This time the error message was 'Access violation in module MSDART.dll'
Can anyone tell me what is wrong with my codes?
Thanks in advance,
Best regards,
Sugi |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|