I was following zcolton's troubleshooting suggestion in another post, which I respect since you start at square one:
=================This Code Works===========
==============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============
============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
=================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>
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>
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