Article View: borland.public.cppbuilder.database.ado
Article #4091Re: Setting Page size on an ado command
From: Vassiliev V.V.
Date: Thu, 11 Apr 2002 06:55
Date: Thu, 11 Apr 2002 06:55
78 lines
3368 bytes
3368 bytes
For first command you can try Select * from AnyTable where 1=0. This can be
faster.
Regards,
Vassiliev V.V.
http://www.oledbdirect.com
"Chris" <Chris.Bucher@sas.com> �������/�������� � �������� ���������:
news:3cb4af93$1_2@dnews...
> 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:
<3cb53574_2@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!news.maxwell.syr.edu!colt.net!news-x2.support.nl!skynet.be!skynet.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsReferences:
<3cb45a8f_2@dnews> <3cb4af93$1_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,9b33b6ac4ab1211f X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-04-11 00:09:07 PST From: "Vassiliev V.V." <news@vassilievvv.mtu-net.ru> Newsgroups: borland.public.cppbuilder.database.ado References: <3cb45a8f_2@dnews> <3cb4af93$1_2@dnews> Subject: Re: Setting Page size on an ado command Date: Thu, 11 Apr 2002 10:55:45 +0400 Lines: 80 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: 62.118.131.12 Message-ID: <3cb53574_2@dnews> X-Trace: dnews 1018508660 62.118.131.12 (11 Apr 2002 00:04:20 -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!news.maxwell.syr.edu!colt.net!news-x2.support.nl!skynet.be!skynet.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews