Article View: borland.public.cppbuilder.database.ado
Article #4086Re: Setting Page size on an ado command
From: Chris
Date: Wed, 10 Apr 2002 21:33
Date: Wed, 10 Apr 2002 21:33
64 lines
2862 bytes
2862 bytes
More info:
I have found a work around, although a little clumsy:
TADOCommand *cmd = new TADOCommand(NULL);
cmd->Connection = conn;
cmd->CommandText = "select cn from
'GC://na.nnn.com/CN=Users,DC=na,DC=nnn,DC=com' where cn='None'";
cmd->Execute(); // I have run one dummy query in order to be able to
set the Page size below
// Now I can set my Page size
cmd->Properties->Item[WideString("Page size")]->Value = 64;
cmd->CommandText = "select cn, mail from
'LDAP://na.nnn.com/CN=Users,DC=na,DC=nnn,DC=com' where objectClass =
'user'";
adods->Recordset = cmd->Execute(); // THE REAL QUERY which will result
in almost 8000 rows
ShowMessage(adods->RecordCount);
"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:
<3cb4af93$1_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!newsfeed.cwix.com!news-hub.siol.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!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-10 14:39:29 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: Wed, 10 Apr 2002 17:33:08 -0400 Lines: 66 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.60 Message-ID: <3cb4af93$1_2@dnews> X-Trace: dnews 1018474387 149.173.13.60 (10 Apr 2002 14:33:07 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!newsfeed.cwix.com!news-hub.siol.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews