LDAP authentify connection with Infopath

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 = 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
 
P

pierrick-allusse

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?



Henning Krause said:
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)


Patrick said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top