Article View: borland.public.cppbuilder.database.ado
Article #405TADOCommand Properties used in conjunction with Active Directory
From: Berthold Stahn
Date: Wed, 01 Nov 2006 10:38
Date: Wed, 01 Nov 2006 10:38
37 lines
2393 bytes
2393 bytes
Hi ,
I'm working on a project querying AD with ADO. The provider is
ADSDsoObject and
you have some provider specific properties of the ADO command object.
I've tried every combination and none of them seemed to work properly. I'm
using
TAdoComand and TAdoConnection. Every time, when I try to set a property
the progam
throws an EOleException: Name or Ordinal not found.
Here's a snipped of my coding:
TListItem *ListItem;
switch ( cbContainer->ItemIndex ) {
case 0 : {
cmdLDAP1->CommandText = "Select cn,adsPath FROM " +
QuotedStr("LDAP://OU=TFD044Groups,OU=TFD044,OU=TFD,OU=FCG,DC=uk,DC=parker,DC=corp")
+
" where objectCategory = 'group' order by cn";
cmdLDAP1->Properties->Item["Page Size"]->Value = 10;
dsLDAP1->Recordset = cmdLDAP1->Execute();
dsLDAP1->First();
for ( int i = 0; i < dsLDAP1->RecordCount; i++)
{
ListItem = lvGroups->Items->Add();
ListItem->Caption = dsLDAP1->Fields->FieldByName("cn")->AsString;
ListItem->SubItems->Add(dsLDAP1->Fields->FieldByName("adsPath")->AsString);
dsLDAP1->Next();
}
} break;
I'm using CBuilder 6 and any idea will be wellcome.
Thanks
Berthold
Technical Details
Message-ID:
<4548792f$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10698b,c7d74688c237e16a,start X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Berthold Stahn" <Berthold.Stahn@teleos-web.de> From: "Berthold Stahn" <Berthold.Stahn@teleos-web.de> Newsgroups: borland.public.cppbuilder.database.ado Subject: TADOCommand Properties used in conjunction with Active Directory Date: Wed, 1 Nov 2006 11:38:41 +0100 Lines: 38 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 NNTP-Posting-Host: 87.245.33.212 Message-ID: <4548792f$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1162377519 87.245.33.212 (1 Nov 2006 02:38:39 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail