BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ADO VCL and MySQL 5

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Sugi
Guest





PostPosted: Tue May 15, 2007 8:09 am    Post subject: ADO VCL and MySQL 5 Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.