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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Troubleshooting a connection to LDAP ... 1

Status
Not open for further replies.

MojoZig

Technical User
Sep 27, 2005
61
US
I was following zcolton's troubleshooting suggestion in another post, which I respect since you start at square one:

=================This Code Works===========
Code:
<%@ Language=VBScript %>
<%
Option Explicit
Dim objADsPath,objDomain, telephonenumber, mail
%>
<html>
<head>
</head>
<body>
<%
Set objDomain = GetObject ("GC://RootDSE")
objADsPath = objDomain.Get("defaultNamingContext")
Set objDomain = Nothing
Response.Write objADsPath & "<BR>"

response.write telephonenumber&"<br>"
response.write mail&"<br>"

%>
</body>
</html>
==============End Working Code=============

The working code returns:
DC=Ocalafl,DC=org
Which is our domain information.

But when I try your next step to see if I can query:

==============Code that errors out============
Code:
<%@ Language=VBScript %>
<%
Option Explicit
Dim con,rs,Com,objADsPath,objDomain
%>
<html>
<head>
</head>
<body bgcolor="#CCCCCC">
<%
Set objDomain = GetObject ("GC://RootDSE")
objADsPath = objDomain.Get("defaultNamingContext")
Set objDomain = Nothing
Set con = Server.CreateObject("ADODB.Connection")
con.provider ="ADsDSOObject"
con.open "Active Directory Provider"
Set Com = CreateObject("ADODB.Command")
Set Com.ActiveConnection = con
Com.CommandText ="select department from 'GC://"+objADsPath+"' WHERE department ='*'"
Set rs = Com.Execute

Do While Not rs.EOF Or rs.BOF

Response.Write rs("department") & "<BR>"

rs.MoveNext
Loop
rs.Close

con.Close
Set rs = Nothing
Set con = Nothing
%>
</body>
</html>
============end erroring code===========

I get the error:

=================================
Provider error '80040e37'

Table does not exist.

/phonebook/test3.asp, line 20
=================================


This is on our intranet so it's inside our network. Is it a permissions problem or is there something I'm not doing correctly.

Thank-you,
Tommy Thomas, MCP, Network+, Security+, C|EH
Senior PC/Network Specialist -::- Webmaster
City of Ocala IT Division
 
zcolton,

I have checked Request.ServerVariables("REMOTE_USER") variable and it is set as myself. Both AUTH_USER and Logon_user are set to my account.
 
john2288,

If I remember correctly, Integrated authentication won't work because of the "double hop" security issues MS has documented throughout their knowledgebase. Try basic authentication and see if it works.

zcolton
 
zcolton,

I tried to do the same in VB. I can get the user ldap information, when I call the setpassword function I get permission denied.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top