Last post Aug 03, 2006 01:36 PM by steve_the_newbie
Aug 03, 2006 08:07 AM|steve_the_newbie|LINK
I'm having difficulties modifying a users' attributes in LDAP.
objDSO = GetObject("LDAP:")
objUser = objDSO.OpenDSObject(strMailboxPath, sUser, sPassword, openFlags)
When I go to update the user, this code doesn't work:
Dim param1 As String = "Title"
Dim param2 As String = "Associate Director"
It results in this error:
System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object args, String paramnames, Boolean CopyBack, Boolean IgnoreReturn) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object Arguments, String ArgumentNames, Type TypeArguments, Boolean CopyBack, Boolean IgnoreReturn) at save_edit.ModifyProperty(Object bstrADsProperty, Object bstrNewValue) in save_edit.aspx.vb:line 157
If I directly update a particular attribute, it works just fine:
objUser.Put("Title", "Associate Director")
What am I missing here? The answer is probably right in front of me, but I just can't see it!
Aug 03, 2006 10:21 AM|dunnry|LINK
Aug 03, 2006 11:51 AM|steve_the_newbie|LINK
Have you considered updating this code to use the .NET classes? If you do you won't regret it later.
I have considered updating this code, but quite frankly the reason I'm not doing so is I wouldn't know where to begin. My username pretty much describes my level of ASP.NET knowledge.
Aug 03, 2006 12:43 PM|dunnry|LINK
Aug 03, 2006 12:47 PM|steve_the_newbie|LINK
Aug 03, 2006 01:36 PM|steve_the_newbie|LINK
Thanks for your advice. I've rewritten the code, tested it, and am quite proud to say it works. Thanks for pointing me in the right direction. You were correct...it was fairly simple.