Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 22nd, 2004, 02:16 AM
urs urs is offline
Registered User
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datatypes in Active Directory

hi,
I connect to the Active Directory in a webapplication through LDAP. That works good, but I have one problem.

When I try to give out the CN, I get an Errormessage.
Response object, ASP 0106 (0x80020005)
An unhandled data type was encountered.


The ADsPath can be given out without any problems.

Please look at my Sourcecode and help me if you can.

Thanks,
Urs

Code:
<%@language="vbscript"%>
<%
Option Explicit
Response.Expires = 0

Dim strQuery
Dim objUser

'---------------------------------------------
'Connection
'---------------------------------------------
Dim objRstMain, objConMain, objCmdMain


Set objRstMain = Server.CreateObject("ADODB.RecordSet")
Set objConMain = Server.CreateObject("ADODB.Connection") 
Set objCmdMain = Server.CreateObject("ADODB.Command")

objConMain = "Provider=ADSDSOObject;User Id=PRIVATE\Administrator;Password=qwerASDF;Encrypt Password=False;Open=Active Directory Provider"

strQuery = "SELECT cn, ADsPath FROM 'LDAP://192.168.1.1/OU=Customers, DC=cust, DC=mydomain, DC=com' WHERE objectCategory='user'"

objCmdMain.ActiveConnection = objConMain
objCmdMain.CommandText = strQuery
%>
<html>
    <head>
    </head>
    <body>
        <table cellspacing="1" cellpadding="1" width="300" border="1" ID="Table1">
            <%
        Set objRstMain = objCmdMain.Execute

        'Response.Write(objRstMain.RecordCount)
        %>
            <b>Anzahl Datensätze: </b>
            <% =objRstMain.RecordCount %>
            <br><br>
        <%
            Do While Not objRstMain.EOF

            %>
            <tr>
                <td><% =objRstMain.Fields("cn").Value %></td>
                <td><% =objRstMain.Fields("ADsPath").Value %></td>
            </tr>
            <%
                objRstMain.MoveNext
            Loop
        objRstMain.Close

        Set objRstMain = Nothing
        Set objConMain = Nothing
        Set objCmdMain = Nothing
    %>
        </table>
    </body>
</html>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Active Directory TCSE305 Windows Server 1 November 22nd, 2006 01:26 AM
About Active Directory apalmero VB How-To 1 April 8th, 2005 04:06 PM
About Active Directory apalmero VS.NET 2002/2003 1 November 9th, 2003 01:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.