[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Add an Entry with ADSI in C++
- To: <openLDAP-software@OpenLDAP.org>
- Subject: Add an Entry with ADSI in C++
- From: "Olivier MATROT" <olivier.matrot@rte.fr>
- Date: Thu, 3 Jun 2004 08:54:14 +0200
- Content-class: urn:content-classes:message
- Thread-index: AcRJN5SSnA1kBBPIStCWWHpXhaTbFQ==
- Thread-topic: Add an Entry with ADSI in C++
I'm trying to create an entry of class 'person' in an OpenLDAP directory
using ADSI.
I could not figure out why this is not working since the only required
attribute is 'sn'.
Here is my code :
HRESULT hr;
IADsContainer *pCont = NULL;
IADs *pADs = NULL;
IDispatch *pDisp = NULL;
CoInitialize(NULL);
hr =
ADsOpenObject(L"LDAP://192.168.3.118/dc=rtetest,dc=org",L"cn=administrat
eur,dc=rtetest,dc=org", L"rtekb", 0, IID_IADsContainer,(void**)&pCont);
hr = pCont->Create(CComBSTR("person"), CComBSTR("cn=JeffSmith"),
&pDisp);
hr = pDisp->QueryInterface(IID_IADs, (void**) &pADs);
hr = pADs->Put(CComBSTR("sn"), CComVariant("JeffSmith"));
hr = pADs->SetInfo(); // Error 0x80072014 the requested operation did
not satisfy one or more contraints associated with the object
Any help appreciated