buki79
-
Total Posts
:
1
- Scores: 0
-
Reward points
:
0
- Joined: 10/17/2005
-
Status: offline
|
Problem with ldap query
Monday, October 17, 2005 9:32 PM
( permalink)
Hi, within an asp page I need to retrieve user information like name and email address. I can do a ldap query to get the full ldap path, but when I try to create an object with that I receive a 80072020 error. Here's the code I used:
<%@ Language=VBScript %>
<%
Response.Buffer=true
strUser=Right(Request.ServerVariables("LOGON_USER"),8)
Set ADOconn = CreateObject("ADODB.Connection")
Set ADOcom = CreateObject("ADODB.Command")
ADOconn.Provider = "ADsDSOObject"
ADOconn.Open "ADs Provider", "xxx\id", "password"
Set ADOcom.ActiveConnection = ADOconn
ADOcom.Properties("Page Size") = 1000
ADOcom.CommandText = "SELECT * from 'LDAP://xxx/dc=w1,dc=yyy,dc=net' where SamAccountName='" & strUser & "'"
Set Rec = ADOcom.Execute
set fields = rec.fields(0)
For Each objField in rec.Fields 'works fine
ldap = objField
response.write "result: " &objField &"<br>"
Next
Set ou=GetObject(ldap) ' here occurs the error
For Each obj In ou
response.write obj.Name & obj.FullName & "<br>"
Next
%>
I'm quite new to vbscript and up to now I'm still confused what to use for which purpose. It's an urgent case and I'm really stuck with that. Any help would be appreciated. Thanks in advance. Regards, Andi
|
|
|
|
corbett
-
Total Posts
:
1
- Scores: 0
-
Reward points
:
0
- Joined: 6/30/2004
- Location: USA
-
Status: offline
|
RE: Problem with ldap query
Thursday, December 22, 2005 9:37 AM
( permalink)
I'm sorry that no one answered you. I was hoping to read the solution, too, because I'm in a similar situation. However, I may have an answer for you if you are not trying to run in a very specific web environment. Send me an email and I'll respond with some sample code.
|
|
|
|
des
-
Total Posts
:
2
- Scores: 0
-
Reward points
:
0
- Joined: 4/17/2008
-
Status: offline
|
RE: Problem with ldap query
Thursday, April 17, 2008 11:31 AM
( permalink)
When I try this code, I get Table does not exist. Any help?
|
|
|
|