hello, I have this login page using asp and ms sql server 2000, but there is error message when running. I am beginner with asp. Could anyone give some detailed suggestion about modifing the code? Thanks very much in advance!
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "Project"
dim username,password
username=Request.Form("user")
password=Request.Form("pass")
set rs = Server.CreateObject("ADODB.recordset")
sql="select * from customer where username='"&username&"'"
rs.Open sql, conn
'If there is no record with the entered username, close connection
'and go back to login with QueryString
If rs.recordcount = "" then
rs.close
conn.close
set rs=nothing
set conn=nothing
Response.Redirect("login.asp?login=namefailed")
end if
'If entered password is right, close connection and open mainpage
'If entered password is wrong, close connection
'and return to login with QueryString
if rs("password") = password then-----Error Type (0x80020009)
Exception occurred
'Session("ID") = rs("username")
rs.Close
conn.Close
set rs=nothing
set conn=nothing
Response.Redirect("productpage_user.asp")
else
rs.Close
conn.Close
set rs=nothing
set conn=nothing
Response.Redirect("login.asp?login=passfailed")
end if
%>
<form name="form" method="post" action="login.asp">
<p><font color="#0066FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Username:
</strong></font>
<input type="text" name="user">
</p>
<p> <font color="#0066FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>
Password: </strong></font>
<input type="password" name="pass">
</p>
<input name="Submit" type="submit" value="login">
<input type="reset" name="Cancel" value="Clear">
</form>