P
Patrick
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 = dspenDSObject(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
.. 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 = dspenDSObject(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