🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TADOQuery and eoASyncFetch problem

#2016
From: littledoudou
Date: Thu, 11 Dec 2003 15:28
52 lines
2735 bytes
hello,

instead of doing this in
void __fastcall TForm1::ADOQuery1FetchComplete(TCustomADODataSet *DataSet,
      const Error *Error, TEventStatus &EventStatus)

try it in
void __fastcall TForm1::ADOQuery1AfterOpen(TDataSet *DataSet)

after you're opening your query, the records will be printed in the list

Ld

"Vic" <victor@espainformatica.com> a �crit dans le message de news:
3fd76a28@newsgroups.borland.com...
> I want to use eoASyncFetch in a ADOQuery to see the progress, the problem
> that I have is that when the query ends the open ( the sql command is a
> SELECT ), when I print the records in a listview, the first record isn't
> printed, and the number of rows in the dataset, isn't the same that the
rows
> printed printed in listview. Here is the code :
>
> void __fastcall TForm1::ADOQuery1FetchComplete(TCustomADODataSet *DataSet,
>       const Error *Error, TEventStatus &EventStatus)
> {
>    ListView1->Items->BeginUpdate();
>    ListView1->Items->Clear();
>    DataSet->First();
>    while (!DataSet->Eof )
>    {
>       TListItem *it = ListView1->Items->Add();
>       it->Caption = DataSet->FieldByName("TEXT1")->Value;
>       it->SubItems->Add(DataSet->FieldByName("TEXT2")->Value);
>       DataSet->Next();
>    }
>    ListView1->Items->EndUpdate();
>    Label1->Caption = "In Dataset " + AnsiString(DataSet->RecordCount) + ",
> in List " + AnsiString(ListView1->Items->Count);
> }
>
> The caption in Label1 is :   'In Dataset 5000, in List 4999'
>
> I think that the error is in the cachesize property ( 1 by default ), but
I
> can't put it to 0.
> There is some way to solve it ?
>
> --
> Victor
> ESPA Inform�tica.
>
>
Technical Details
Message-ID: <3fd88d04@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3fd76a28@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,361a11b4c91b34f
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-12-11 07:40:08 PST
From: "littledoudou" <littldoudou@voila.fr>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3fd76a28@newsgroups.borland.com>
Subject: Re: TADOQuery and eoASyncFetch problem
Date: Thu, 11 Dec 2003 16:28:24 +0100
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 62.161.106.155
Message-ID: <3fd88d04@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1071156484 62.161.106.155 (11 Dec 2003 07:28:04 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail