🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TADOQuery and eoASyncFetch problem

#2015
From: Viatcheslav V. Vassiliev
Date: Thu, 11 Dec 2003 13:44
106 lines
4907 bytes
It is interesting. This will not solve your problem, but it is not with
CacheSize - it is with ADO Express. However exactly CacheSize first rows are
missed:

procedure TForm1.ADOQuery1FetchComplete(DataSet: TCustomADODataSet;
  const Error: Error; var EventStatus: TEventStatus);
var
  ListItem: TListItem;
  i: Integer;
begin
  i := 0;

  DataSet.First;
  DataSet.Recordset.MoveFirst();
  with ListView1 do
  begin
 while ( DataSet.Eof = false ) do
 begin
   ListItem := Items.Add;
   ListItem.Caption := //DataSet.FieldValues['OrderID'];
  DataSet.Recordset.Fields['OrderID'].Value;
   ListITem.SubItems.Add(//DataSet.FieldValues['ProductID']);
  DataSet.Recordset.Fields['ProductID'].Value);
   Inc(i);
   DataSet.Next;
 end;
  end;
  Label1.Caption := 'Dataset '+ IntToStr(Dataset.RecordCount) + ' Items ' +
 IntToStr(ListView1.Items.Count) + ' Items2 ' + IntToStr(i);
end;

I added variable i to be sure that the problem is not in TListView (in other
tests I commented all TListView-related code). I found that if I use ADO
recordset methods (avoiding TDataSet methods) all works correctly.
DataSet.Recordset.MoveFirst() added to position to first record and
DataSet.FieldValues['FieldName'] should be changed to
DataSet.Recordset.Fields['FieldName'].Value. Now correct number is
displayed. Tested with [Order Details] table from Northwind database, MS SQL
Server.

//------------------------------------------
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:3fd86d01@newsgroups.borland.com...
> Thanks Vassiliev for your replies, but the BetterADODataset component
> neither works. It try it in delphi, and gives me the same problem.
> This is what I do ( in delphi )
>
> procedure TForm1.Button1Click(Sender: TObject);
> begin
>   BetterADODataSet1.Open;
> end;
>
> procedure TForm1.BetterADODataSet1FetchComplete(DataSet:
TCustomADODataSet;
>   const Error: Error; var EventStatus: TEventStatus);
> var
>   ListItem: TListItem;
> begin
>   DataSet.First;
>   with ListView1 do
>   begin
>     while ( DataSet.Eof = false ) do
>     begin
>       ListItem := Items.Add;
>       ListItem.Caption := DataSet.FieldValues['TEXTO1'];
>       ListITem.SubItems.Add(DataSet.FieldValues['TEXTO2']);
>       DataSet.Next;
>     end;
>   end;
>   Label1.Caption := 'Dataset '+ IntToStr(Dataset.RecordCount) + ' Items '
+
> IntToStr(ListView1.Items.Count);
> end;
>
> The result is the same : Dataset 5000 Items 4999
> I see that if I put CacheSize to 20, the result is 'Dataset 5000 Items
> 4980'. I think that the problem is in the CacheSize property. How can I
put
> the CacheSize to 0 ?? , or where are the rows that are loaded in the cache
?
>
>
>
> "Viatcheslav V. Vassiliev" <support@oledbdirect.com> escribi� en el
mensaje
> news:3fd85c21$1@newsgroups.borland.com...
> > That is difficult to say why it happens but you may try to install
> > BetterADODataSet from http://web.orbitel.bg/vassil/. It has no BCB
version
> > but I do not think there will be problems installing it.
> >
> > //------------------------------------------
> > 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)
> >
>
>
Technical Details
Message-ID: <3fd874b0@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!green.octanews.net!news.octanews.net!cox.net!news-xfer.cox.net!in.100proofnews.com!in.100proofnews.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3fd76a28@newsgroups.borland.com> <3fd80f4e@newsgroups.borland.com> <3fd82a7b@newsgroups.borland.com> <3fd85c21$1@newsgroups.borland.com> <3fd86d01@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 06:04:23 PST
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3fd76a28@newsgroups.borland.com> <3fd80f4e@newsgroups.borland.com> <3fd82a7b@newsgroups.borland.com> <3fd85c21$1@newsgroups.borland.com> <3fd86d01@newsgroups.borland.com>
Subject: Re: TADOQuery and eoASyncFetch problem
Date: Thu, 11 Dec 2003 16:44:06 +0300
Lines: 108
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: <3fd874b0@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1071150256 213.234.218.42 (11 Dec 2003 05:44:16 -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!green.octanews.net!news.octanews.net!cox.net!news-xfer.cox.net!in.100proofnews.com!in.100proofnews.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail