When I try to login, it keeps saying my password is incorrect. I am trying to set the userid as a session variable. This field is autonumber in an access database. Here is the code I am using. I have added one user to the database. Any ideas?
<%
Response.Buffer = True
Dim objConn, objRS
Session.Contents("userid") = ""
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DSN=survey"
Set objRS = objConn.Execute("SELECT * FROM tblusers WHERE username = '" & _
Request.Form("username") & "'")
If Not objRS.EOF Then
If objRS(1) = Request.Form("password") Then
Session.Contents("userid") = objRS(2)
Response.Redirect "menu.asp"
Else
Response.Write "Sorry, but the password that you entered is incorrect."
End If
Else
Response.Write "Sorry, that username does not exist."
End If
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>