
Problem creating ADODB.command object in asp.
I'm trying to query the AD and provide a return list of
computers, locations and descriptions then jam that onto a
page so that our support staff can read the arbitrary
computer names and associate those with a user/location.
The following code snippet (and subsequent handling of the
results) runs quite well in C/Wscript and displays quite
nicely through PrimalScript. Unfortunately, when I attempt
to include these statements in an ASP page, I'm getting an
error on creating the adodb.command object (second create
object).
Any thoughts? (Pardon me if I'm overlooking something
completely simple).
Const ADS_SCOPE_SUBTREE = 2
strCompDesc = ""
Set objConnection = CreateObject("ADODB.Connection") 'This
create object functions just fine
Set objCommand = CreateObject("ADODB.Command") 'This
command fails in ASP
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCOmmand.ActiveConnection = objConnection
objCommand.CommandText = _
"Select Name, Location, Description
from 'LDAP://CN=computers,DC=x,DC=y,DC=z,DC=w' " _
& "where objectClass='computer' order by Name"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30