5 Replies Latest reply on Feb 23, 2015 12:21 PM by bregent

    Item cannot be found in the collection corresponding to the requested name or ordinal.

    cmd_jonathan Level 1



      I am using Dreamweavers User Authentication tool, and all seems to be working except when I press the 'Submit' button I get the following error;


      ADODB.Fields error '800a0cc1'

      Item cannot be found in the collection corresponding to the requested name or ordinal.

      /coding/test_login.asp, line 35

      As far as I can tell the user login works, as I can assess the restricted page, if I manually type in the URL.

      My code is listed below;


      <!--#include file="Connections/Conn_PSCRM_Demo.asp" -->


      ' *** Validate request to log in to this site.

      MM_LoginAction = Request.ServerVariables("URL")

      If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)

      MM_valUsername = CStr(Request.Form("usercode"))

      If MM_valUsername <> "" Then

        Dim MM_fldUserAuthorization

        Dim MM_redirectLoginSuccess

        Dim MM_redirectLoginFailed

        Dim MM_loginSQL

        Dim MM_rsUser

        Dim MM_rsUser_cmd


        MM_fldUserAuthorization = """group"""

        MM_redirectLoginSuccess = "yes.asp"

        MM_redirectLoginFailed = "no_access.asp"



        MM_loginSQL = "SELECT usercode, epros_password"

        If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization

        MM_loginSQL = MM_loginSQL & " FROM DBA.[user] WHERE usercode = ? AND epros_password = ?"

        Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")

        MM_rsUser_cmd.ActiveConnection = MM_Conn_PSCRM_Demo_STRING

        MM_rsUser_cmd.CommandText = MM_loginSQL

        MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 255, MM_valUsername) ' adVarChar

        MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 255, Request.Form("password")) ' adVarChar

        MM_rsUser_cmd.Prepared = true

        Set MM_rsUser = MM_rsUser_cmd.Execute



        If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then

          ' username and password match - this is a valid user

          Session("MM_Username") = MM_valUsername

          If (MM_fldUserAuthorization <> "") Then

            Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)


            Session("MM_UserAuthorization") = ""

          End If

          if CStr(Request.QueryString("accessdenied")) <> "" And true Then

            MM_redirectLoginSuccess = Request.QueryString("accessdenied")

          End If



        End If



      End If


      <!doctype html>



      <meta charset="utf-8">

      <title>Untitled Document</title>





      <form action="<%=MM_LoginAction%>" method="POST" name="logon">

      <input name="usercode" type="text"><br>

      <input name="password" type="text">

      <input type="submit" name="Submit" id="Submit" value="Submit">





      Any help greatly accepted.