Have anybody ever updated user-data in active directory using ADO? I have the following codeThis code works fine but what I need to do is to update the information. So when I addCode:Set objConn = Server.CreateObject("ADODB.Connection") objConn.Provider = "ADsDSOObject" Set objRootDSE = GetObject("LDAP://RootDSE") strDomain = objRootDSE.Get("DefaultNamingContext") objConn.Properties("ADSI Flag") = 1 objConn.Properties("User ID") = "internal\ADuser" objConn.Properties("Password") = "somepassword" objConn.Properties("Encrypt Password") = True objConn.Open "Active Directory Provider" Set objCommand = CreateObject("ADODB.Command") Set objCommand.ActiveConnection = objConn strCommandText = "<LDAP://OU=MYCOMPANYNAME," & strDomain & ">;(samAccountName=mylogonaccountname);Title,samAccountName,Company,department,facsimileTelephoneNumber,Displayname,mobile,physicalDeliveryOfficeName,PostalAddress,postalCode,telephoneNumber,mail,homephone;subtree" objCommand.CommandText = strCommandText set objRS = Server.CreateObject("ADODB.recordset") objRS.LockType = 4 'adLockPessimistic objRS.Open strCommandText, objConn Response.Write(objRS("DisplayName"))I get the following error message:Code:objRS("DisplayName") = "Lumbago is a dumba$$"
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
All help is appreciated! I have worked on this for more than 6 hours now and I hope someone canhelp...![]()


Reply With Quote
Bookmarks