🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TADOQuery and eoASyncFetch problem

#2020
From: Viatcheslav V. Vassiliev
Date: Thu, 11 Dec 2003 19:39
108 lines
4971 bytes
You may also need to add to any cpp unit.


#include <comobj.hpp>

namespace System
{
 void __fastcall CheckSafecallResult(HRESULT hr)
 {
  OleCheck(hr);
 }
}

for BCB6, BCB5 should work without this.

//------------------------------------------
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)

"Viatcheslav V. Vassiliev" <support@oledbdirect.com> �������/�������� �
�������� ���������: news:3fd8c747$2@newsgroups.borland.com...
> DataSet->Recordset->Fields->Item[WideString("OrderID")]->Value;
>
> //------------------------------------------
> 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:3fd891a0$1@newsgroups.borland.com...
> > Thanks Vassiliev, that works perfert!!. The problem that I have now is
> when
> > I try to write it in C++.
> > Which is the way to do this in Builder ? :
> > DataSet.Recordset.Fields['OrderID'].Value
> >
> > All the other things works perfect in Builder too. Thanks
> >
> > "Viatcheslav V. Vassiliev" <support@oledbdirect.com> escribi� en el
> mensaje
> > news:3fd874b0@newsgroups.borland.com...
> > > 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)
> > >
> >
> >
>
>
>
Technical Details
Message-ID: <3fd8c7fc$1@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!in.100proofnews.com!in.100proofnews.com!news-xfer.cox.net!peer01.cox.net!cox.net!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!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> <3fd874b0@newsgroups.borland.com> <3fd891a0$1@newsgroups.borland.com> <3fd8c747$2@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 11:56:39 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> <3fd874b0@newsgroups.borland.com> <3fd891a0$1@newsgroups.borland.com> <3fd8c747$2@newsgroups.borland.com>
Subject: Re: TADOQuery and eoASyncFetch problem
Date: Thu, 11 Dec 2003 22:39:42 +0300
Lines: 110
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: <3fd8c7fc$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1071171580 213.234.218.42 (11 Dec 2003 11:39:40 -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!in.100proofnews.com!in.100proofnews.com!news-xfer.cox.net!peer01.cox.net!cox.net!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail