I'm using a VBScript which binds Active Directory with LDAP Protocol and with
. It works on each client computer.
I'm using the OpenDSObject method which binds to an ADSI object.But when i
put my script on Infopath, it returns me a error on the above line :
set dso = GetObject("LDAP:")
This is an exemple of my script :
'******************************************************
'Constants
const ADS_SECURE_AUTHENTICATION = &h1
const ADS_SERVER_BIND = &h200
'Global variables
Dim pDomain
Dim pUser
Dim pPwd
Dim strName
Dim pServer
Dim sLDAPPath
sLDAPPath = <ConnectionPath>
pUser = <A user who has administrators rights on Active Directory>
pPwd = <his password>
strName = <Search string>
'connexion --> ERROR !!!
set dso = GetObject("LDAP:")
if (pServer<>"") then
sFullPath = "LDAP://" & pServer & "/" & sLDAPPath
else
sFullPath = "LDAP://" & sLDAPPath
end if
set oContainer = dso.OpenDSObject(sFullPath, pUser , pPwd, _
ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND)
oContainer.Filter = Array("user")
For each usr in oContainer
if instr(usr.name, strname) <> 0 then
XDocument.DOM.selectSingleNode("/my:mesChamps/my:txt_mail").text=
usr.mail
end if
Next
'*********************************************************
I don't understand why in Infopath, my code hangs a error !!! Do you have an
idea???
Thx a lot
Henning Krause [MVP] - 07 Jun 2005 21:07 GMT
Hello,
could you please post what type of error you get? Probaby an error number?
Greetings,
Henning Krause [MVP - Exchange]
==========================
Visit my website: http://www.infinitec.de
Try my free Exchange Explorer: Mistaya
(http://www.infinitec.de/software/mistaya.aspx)
> I'm using a VBScript which binds Active Directory with LDAP Protocol and
> with
[quoted text clipped - 47 lines]
> idea???
> Thx a lot
pierrick-allusse - 07 Jun 2005 22:04 GMT
In fact, the error is an 424 error (an object is required !). But the
error's line is this :
set oContainer = dso.OpenDSObject(sFullPath, pUser , pPwd, _
ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND)
and not : set dso = GetObject("LDAP:")
But i think the object dso is a null object but i don't understand why?
> Hello,
>
[quoted text clipped - 59 lines]
>> idea???
>> Thx a lot