Article View: borland.public.cppbuilder.database.ado
Article #4095Re: Setting Page size on an ado command
From: Chris
Date: Thu, 11 Apr 2002 15:13
Date: Thu, 11 Apr 2002 15:13
60 lines
2739 bytes
2739 bytes
Ok, I solved the problem. Borland does not set the connection to the
command until Execute is called. So you need to do it yourself in order to
set the Page Size property. See below:
// Need to set in order to set Page size
cmd->CommandObject->Set_ActiveConnection(conn->ConnectionObject);
// Need to set page size in order to retrieve more than 1000 records
cmd->Properties->Item[WideString("Page size")]->Value = 64; // Note:
Must use cast to WideString
rc->Recordset = cmd->Execute();
Thanks to Vassiliev V.V. for your assistance.
"Chris" <Chris.Bucher@sas.com> wrote in message news:3cb45a8f_2@dnews...
> I have Borland C++ Builder 6 and I am am trying to run a query against the
> active directory.
> The problem is that only 1000 records are returned. The solution is to
set
> the Page Size property of the Command object
> to a larger number, say 64. This works in VB.
>
> When I try it in C++ Builder, first it gave me a linker error that
> CheckAutoResult was not found.
> I worked around that problem by adding:
>
> namespace System {
> void __fastcall CheckSafecallResult(HRESULT hr)
> {
> OleCheck(hr);
> }
> }
>
> Now when I set the property the error code says that property is not
> available.
>
> Here is the code:
>
> comm->Properties->Item["Page Size"]->Value = 64; // This line
> gives an error saying that Page Size is not in the collection.
> rc->Recordset = comm->Execute();
>
> while(!rc->Eof){
> ... do something
> rc->Next();
> }
>
> If I take out the Page size setting, the code does work but only retreives
> 1000 rows (an Active Directory thing).
>
> Can someone help me?
>
> Thanks
> Chris
>
>
Technical Details
Message-ID:
<3cb5a805$1_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!feed2.news.rcn.net!rcn!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsReferences:
<3cb45a8f_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,9b33b6ac4ab1211f X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-04-11 08:26:57 PST From: "Chris" <Chris.Bucher@sas.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3cb45a8f_2@dnews> Subject: Re: Setting Page size on an ado command Date: Thu, 11 Apr 2002 11:13:10 -0400 Lines: 62 Organization: SAS 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: 149.173.13.76 Message-ID: <3cb5a805$1_1@dnews> X-Trace: dnews 1018537989 149.173.13.76 (11 Apr 2002 08:13:09 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!feed2.news.rcn.net!rcn!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews