LDAP with ASP unable to validate user details

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hgchethankumar
    New Member
    • Feb 2008
    • 2

    LDAP with ASP unable to validate user details

    Hi All,


    <%@ LANGUAGE="VBSCR IPT" %>

    <form method="POST">

    <%
    Dim rstUsers
    Dim objDSE, strNamingContex t
    Set objDSE = GetObject("LDAP ://rootDSE")
    strNamingContex t = objDSE.Get("def aultNamingConte xt")
    Set objDSE = Nothing

    set rstUsers= CreateObject("A DODB.Recordset" )
    rstUsers.Open "SELECT sAMAccountName FROM 'LDAP://CN=Users," & strNamingContex t & "' WHERE objectClass='us er' and sAMAccountName= 'Chethan' and userpassword='b c123' ORDER BY sAMAccountName" , "Provider=ADsDS OObject"

    if not rsUsers.eof then
    While Not rstUsers.EOF
    response.write "<b>" & rstUsers("sAMAc countName").Val ue & "</b>"

    rstUsers.MoveNe xt
    Wend
    else
    Response.Write "Account Details not found"
    end if
    rstUsers.Close
    Set rstUsers = Nothing
    %>


    </form>

    The above code is showing

    Error Type:
    (0x8007054B)
    /sulzer/ldap2.asp, line 9

    I am unable to resolve this error .

    Please any one can help me>>>
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Which is line 9?

    Dr B

    Comment

    • hgchethankumar
      New Member
      • Feb 2008
      • 2

      #3
      Originally posted by DrBunchman
      Which is line 9?

      Dr B


      Set objDSE = GetObject("LDAP ://rootDSE")

      Regards,
      Chethan Kumar

      Comment

      • DrBunchman
        Recognized Expert Contributor
        • Jan 2008
        • 979

        #4
        Then I'd suggest it may be a domain issue, because I can run your code on my machine without any errors, but I'm afraid I can't offer you any more advice than that.

        You may be better off seeking help in the IIS forum unless any of the guys here can help you?

        Good luck
        Dr B

        Comment

        Working...