🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #322

Re: TADOQuery problem

#322
From: Viatcheslav V. Vassiliev
Date: Fri, 04 Aug 2006 16:12
44 lines
2395 bytes
Add

CountQuery->Close();

when you do not need this dataset open. Btw if in first dataset you want to 
get count of records in second dataset, you will have wrong result - select 
count(bid) returns count of rows where bid is not null.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"Cenk" <cenk1536@yahoo.com> �������/�������� � �������� ���������: 
news:44d36e64@newsgroups.borland.com...
> 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?
>
> 
Technical Details
Message-ID: <44d37209@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!tudelft.nl!txtfeed1.tudelft.nl!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <44d36e64@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,8c96c50763dd0dab
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <44d36e64@newsgroups.borland.com>
Subject: Re: TADOQuery problem
Date: Fri, 4 Aug 2006 20:12:53 +0400
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Response
X-Antivirus: avast! (VPS 0631-2, 02.08.2006), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 85.93.138.132
Message-ID: <44d37209@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1154707977 85.93.138.132 (4 Aug 2006 09:12:57 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!tudelft.nl!txtfeed1.tudelft.nl!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail