🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TADOQuery and eoASyncFetch problem

#2008
From: Viatcheslav V. Vassiliev
Date: Wed, 10 Dec 2003 18:59
51 lines
2918 bytes
Try the next: from ADOQuery1FetchComplete() post a message to form:
PostMessage(Handle, WM_MYMESSAGE, 0, 0), then create message handler and
fill your list box from this handler.

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


"Vic" <victor@espainformatica.com> �������/�������� � �������� ���������:
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: <3fd80f4e@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!priapus.visi.com!orange.octanews.net!news.octanews.net!news-out.visi.com!petbe.visi.com!eusc.inter.net!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-10 22:39:07 PST
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3fd76a28@newsgroups.borland.com>
Subject: Re: TADOQuery and eoASyncFetch problem
Date: Wed, 10 Dec 2003 21:59:18 +0300
Lines: 53
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 213.234.218.42
Message-ID: <3fd80f4e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1071124302 213.234.218.42 (10 Dec 2003 22:31:42 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!priapus.visi.com!orange.octanews.net!news.octanews.net!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail