🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: recordset populating problem

#2866
From: Viatcheslav V. Vassiliev
Date: Wed, 12 Mar 2003 15:22
74 lines
3722 bytes
It is true for ADO recordset object, not only for ADO Express. ADO Command
object Execute method returns Recordset object, so you may be can do:

Recordset = ADOCommand1->Execute(RecordsAffected, EmptyParam, adCmdText);

Client-side cursor fetchs all rows from query (table) into memory, so you
should decide do you need advanced features (such as record count, filter,
sort) with client-side cursor or faster code with server-side cursor
(sometimes client-side cursor can be faster).

----------------------------------------------------------------
Regards,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to access MS SQL Server, MS Jet (MS Access)
and Interbase (through OLEDB) databases.

"Tom Jowitt" <tomjowitt@hotmail.com> ???????/???????? ? ???????? ?????????:
news:3e6f2390@newsgroups.borland.com...
> thanks but i am not using ADOExpress as i have BCB5 Pro edition and
> hence cannot use ADOExpress without a significant upgrade.
>
> the add-on i use uses TADORecordset
>
> i got it working by changing the cursor type like you said. thanks!
>
> Viatcheslav V. Vassiliev wrote:
> > It is normal if you are with server-side cursor. If OLEDB provider can
not
> > return affected rows quickly, it can return -1. Recordset (there is not
> > TADORecordset object in ADO Express) is returned by TADOCommand.Execute
> > method.
> >
> > This is a sample from help:
> >
> > with ADOCommand1 do begin
> >   CommandText := 'SELECT Company, State ' +
> >     'FROM customer ' +
> >     'WHERE State = :StateParam';
> >   CommandType := cmdText;
> >   Parameters.ParamByName('StateParam').Value := 'HI';
> >   ADODataSet1.Recordset := Execute;
> > end;
> >
> > ----------------------------------------------------------------
> > Regards,
> > Viatcheslav V. Vassiliev
> > http://www.oledbdirect.com
> > The fastest way to access MS SQL Server, MS Jet (MS Access)
> > and Interbase (through OLEDB) databases.
> >
> > "Tom Jowitt" <tomjowitt@hotmail.com> ???????/???????? ? ????????
?????????:
> > news:3e6f0910$1@newsgroups.borland.com...
> >
> >>i have problems using the TADORecordset function. i can use commands to
> >>execute SQL but can use the Recordsets. everytime i populate a recordset
> >>it brings back the recordcount as -1. this is how i execute the SQL:
> >>
> >>ADOCommand1->Close();
> >>ADOCommand1->CommandText = "SELECT Wellname FROM Wells";
> >>ADOCommand1->Active=true;
> >>ADOCommand1->Open();
> >>
> >>ADOCommand1->Execute(RecordsAffected, EmptyParam, adCmdText);
> >>
> >>how do i return a recordset from this command?
> >>
> >>cheers in advance
> >>
> >
> >
> >
>
Technical Details
Message-ID: <3e6f512f@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3e6f0910$1@newsgroups.borland.com> <3e6f1cd1$2@newsgroups.borland.com> <3e6f2390@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,7058e89c5142fa3b
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-03-12 07:40:11 PST
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3e6f0910$1@newsgroups.borland.com> <3e6f1cd1$2@newsgroups.borland.com> <3e6f2390@newsgroups.borland.com>
Subject: Re: recordset populating problem
Date: Wed, 12 Mar 2003 18:22:21 +0300
Lines: 76
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 213.247.201.57
Message-ID: <3e6f512f@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1047482671 213.247.201.57 (12 Mar 2003 07:24:31 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail