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 

TADOConnection problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Cenk
Guest





PostPosted: Fri Aug 04, 2006 8:49 pm    Post subject: TADOConnection problem Reply with quote



Hi,

I wanna use multiple select statements as below but it gives error, would
you please help?

sample code segment.

TADOQuery *CountQuery;
CountQuery= new TADOQuery (this);
CountQuery->Connection = ADOConnection1;

CountQuery->SQL->Add ("select COUNT(bid) from ["+table+"]");
CountQuery->Open ();
count = CountQuery->FieldByName ("COLUMN1")->AsInteger;


CountQuery->SQL->Clear(); --------> CAN NOT PERFORM THIS OPERATION ON AN
OPEN DATASET!
CountQuery->SQL->Add ("select [bid],[fTime] from ["+table+"] order by
[fTime] ASC");
CountQuery->Open ();

How can i use multiple TADOQuery?
Back to top
MarkR
Guest





PostPosted: Fri Aug 04, 2006 8:59 pm    Post subject: Re: TADOConnection problem Reply with quote



Quote:
CountQuery->Open ();
count = CountQuery->FieldByName ("COLUMN1")->AsInteger;

Try CountQuery->Close();

Quote:


CountQuery->SQL->Clear(); --------> CAN NOT PERFORM THIS OPERATION ON AN
OPEN DATASET!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers) 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.