Berthold Stahn Guest
|
Posted: Wed Nov 01, 2006 4:38 pm Post subject: TADOCommand Properties used in conjunction with Active Direc |
|
|
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 |
|