Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making connection to LDAP via VB Script

Status
Not open for further replies.

murgiar

Programmer
Jun 30, 2009
1
US
I typically create ASP files using VB Script connecting to SQL Server as follows:

strSQL = "Select * from tblEmployee"
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB.1;Password=xxxxxxx; etc.
Set rec = Server.CreateObject("ADODB.Recordset")
rec.Open strSQL, conn

I need to do the same for the LDAP server and found the following code on the web which I tried to use:

Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection

objCommand.CommandText = _
"<LDAP://dc=fabrikam,dc=com>;(objectCategory=User);Name;Subtree"
Set objRecordSet = objCommand.Execute

I get the message:provider error '80040e37'
Table does not exist.
/dealercpc/LDAPTest.asp, line 70

I can connect to LDAP via Softerra LDAP Browser 2.6 with the following information:

Host: ssodsdev.xxxxxxx
Port:8389
base: dc=opensso,dc=java,dc=net
UserId: CN=Directory Manager
Password:xxxxxxxx

How is this information communicated to the program. Should this line:
"<LDAP://dc=fabrikam,dc=com>;(objectCategory=User);Name;Subtree"
be somehow changed to reflect the above information?
 
On the face of it, this is a necessary change other than the security-related issues that may have.
>"<LDAP://dc=fabrikam,dc=com>;(objectCategory=User);Name;Subtree"
[tt]"<LDAP://dc=opensso,dc=java,dc=net>;(objectCategory=User);Name;Subtree"[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top