Article View: borland.public.cppbuilder.database.ado
Article #517Re: How to retrieve data from an ADO query
From: Viatcheslav V. Vassiliev
Date: Tue, 30 Aug 2005 16:58
Date: Tue, 30 Aug 2005 16:58
63 lines
2920 bytes
2920 bytes
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();
}
//------------------------------------------
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)
"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();
> }
>
>
>
> --
> Best regards,
> Vladimir Stefanovic
> "George Nakos" <gnakos@metronco.gr> wrote in message
> news:op.swbnqgj9qf2fxd@promitheas.metron.internal...
> Greetings,
>
> I know that this topic should tire you as I suspect that it has been
> answered a lot of times, but the answers I read didn't cover my needs.
>
> My situation is this: I am using a TADOQuery to do some SQL queries to an
> MS Access database. This works fine, and I can even put the results in a
> dataset and display them using TDBText objects on screen.
>
> My problem is that I don't want to display the data on screen, just store
> them in arrays and use them whenever necessary.
>
> If someone could provide a step-by-step process on how to do this, and
> providing a few lines of sample code, I would be most grateful.
>
>
>
> Thanks,
> George Nakos
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
>
Technical Details
Message-ID:
<43148ffa@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed.inode.at!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>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,8fb1b60fd2dcc362 X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <op.swbnqgj9qf2fxd@promitheas.metron.internal> <4314651e@newsgroups.borland.com> Subject: Re: How to retrieve data from an ADO query Date: Tue, 30 Aug 2005 20:58:13 +0400 Lines: 65 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 85.93.138.132 Message-ID: <43148ffa@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1125421050 85.93.138.132 (30 Aug 2005 09:57:30 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed.inode.at!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail