Article View: borland.public.cppbuilder.database.ado
Article #518Re: How to retrieve data from an ADO query
From: George Nakos
Date: Wed, 31 Aug 2005 06:58
Date: Wed, 31 Aug 2005 06:58
43 lines
2241 bytes
2241 bytes
> "Vladimir Stefanovic" <antivari@po.sbb.co.yu> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
> ÓÌÅÄÕÀÝÅÅ: news:4314651e@newsgroups.borland.com...
>> Something like this /UNTESTED!!!/
>>
>> ADOQuery1->Open();
>>
>> for ( int i=0; i<ADOQuery1->RecordCount; i++ )
>> {
>> AnsiString ROW = ADOQuery1->FieldValues["Field1"] + ", " +
>> ADOQuery1->FieldValues["Field2"];
>> SomeStringList->Add( ROW );
>> ADOQuery1->Next();
>> }
Firstly, thanks a LOT for this snippet! It works like a charm!
> Usually it is very not optimized, in some cases may be slow and in some
> cases buggy. Better way is:
>
> ADOQuery1->Open();
> while (!ADOQuery->EOF)
> {
> .....
> ADOQuery1->Next();
> }
>
Hmm, the only difference I can notice between the 2 bits of code is the
2nd doesn't use RecordCount. Is this the "unoptimised, slow and buggy" bit?
Regards,
George Nakos
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Technical Details
Message-ID:
<op.swc1m3q7qf2fxd@promitheas.metron.internal>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed1.ip.tiscali.net!tiscali!newsfeed2.ip.tiscali.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<op.swbnqgj9qf2fxd@promitheas.metron.internal> <4314651e@newsgroups.borland.com> <43148ffa@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,8fb1b60fd2dcc362 X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,UTF8 Newsgroups: borland.public.cppbuilder.database.ado Subject: Re: How to retrieve data from an ADO query References: <op.swbnqgj9qf2fxd@promitheas.metron.internal> <4314651e@newsgroups.borland.com> <43148ffa@newsgroups.borland.com> Message-ID: <op.swc1m3q7qf2fxd@promitheas.metron.internal> Date: Wed, 31 Aug 2005 09:58:05 +0300 From: "George Nakos" <gnakos@metronco.gr> Organization: Metron LTD Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable User-Agent: Opera M2/8.10 (Win32, build 7685) NNTP-Posting-Host: 83.235.222.66 X-Trace: newsgroups.borland.com 1125471379 83.235.222.66 (30 Aug 2005 23:56:19 -0700) Lines: 43 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed1.ip.tiscali.net!tiscali!newsfeed2.ip.tiscali.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail