I have two asp files. Login.asp and changePass.asp. what i want to do is to make the user change his password after his first login. so what happens is login.asp is the first to be used then it is passed to changePass.asp but after creating the code. I am getting this error
ADODB.Recordset (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
The codes are here
Login.asp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<Title>
Login
</Title>
</HEAD>
<BODY>
<p align="center"><font color="#0000FF" size="5">Insurance System</font></p>
<hr>
<p>
<!-- #include file="adovbs.inc" -->
<%
Response.Buffer = True
If Request.Form ("Submit") <> "Login" then
Response.Cookies("username") = ""
%>
</p>
<FORM ACTION="login.asp" METHOD="post" id=form1 name=form1>
<center><TABLE BORDER=0>
<TR>
<TD ALIGN="right">Username:</TD>
<TD><INPUT NAME="user"></INPUT></TD>
</TR>
<TR>
<TD ALIGN="right">Password:</TD>
<TD><INPUT TYPE="password" NAME="password"></INPUT></TD>
</TR>
<TR>
<TD ALIGN="right"></TD>
<TD><INPUT TYPE="submit" VALUE="Login" name=Submit></INPUT>
<INPUT TYPE="reset" VALUE="Reset" id=reset1 name=reset1></INPUT>
</TD>
</TR>
</TABLE>
</FORM>
<%
Else
Dim DB_CONNECTIONSTRING, objCleanUpRS, iRecordCount, LoginSuccessful
LoginSuccessful = False
DB_CONNECTIONSTRING = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Insurance"
strSQL = "SELECT * FROM Login Where Username = '" & Request.Form("user") & "' and Password = '" & Request.Form("password") & "';"
Dim USE
Dim PAS
USE = cStr(Request.Form("user"))
Set objCleanUpRS = Server.CreateObject("ADODB.Recordset")
objCleanUpRS.Open strSQL, DB_CONNECTIONSTRING, adOpenKeyset, adLockPessimistic, adCmdText
If Not objCleanUpRS.EOF Then
LoginSuccessful=True
if objCleanUpRS.Fields("Times") <> 0 then
If LoginSuccessful then
%>
<center>
<%
Response.Write("login successful")
Response.Cookies("username") = USE
%>
<br><center><a href="#">Go to main page</a>
<%
objCleanUpRS.Close
Set objCleanUpRS = Nothing
End If
else
objCleanUpRS.Close
Set objCleanUpRS = Nothing
%>
<FORM ACTION="changePass.asp" METHOD="post" id=form1 name=form1>
<center><TABLE BORDER=0>
<TR>
Please input a new password to change your temporary password
</TR>
<TR>
<TD ALIGN="right">Password:</TD>
<TD><INPUT TYPE="password" NAME="password"></INPUT></TD>
</TR>
<TR>
<TD ALIGN="right"></TD>
<TD><INPUT TYPE="submit" VALUE="OK" name=Submit></INPUT>
<INPUT TYPE="reset" VALUE="Reset" id=reset1 name=reset1></INPUT>
</TD>
</TR>
</TABLE>
</FORM>
<%
End if
else
%>
<center>
<%
Response.Write("login unsuccessful")
%>
<FORM ACTION="login.asp" METHOD="post" id=form1 name=form1>
<center><TABLE BORDER=0>
<TR>
<TD ALIGN="right">Username:</TD>
<TD><INPUT NAME="user"></INPUT></TD>
</TR>
<TR>
<TD ALIGN="right">Password:</TD>
<TD><INPUT TYPE="password" NAME="password"></INPUT></TD>
</TR>
<TR>
<TD ALIGN="right"></TD>
<TD><INPUT TYPE="submit" VALUE="Login" name=Submit></INPUT>
<INPUT TYPE="reset" VALUE="Reset" id=reset1 name=reset1></INPUT>
</TD>
</TR>
</TABLE>
</FORM>
<%
Response.End
End If
End if
%>
</BODY>
</HTML>
and
changePass.asp
<%
Dim DB_CONNECTIONSTRING, objCleanUpRS
DB_CONNECTIONSTRING = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Insurance"
strSQL = "SELECT * FROM Login WHERE 0 = 1;"
if isNull(Request.Form("password")) <> true then
Set objCleanUpRS = Server.CreateObject("ADODB.Recordset")
objCleanUpRS.Open strSQL, DB_CONNECTIONSTRING, adOpenKeyset, adLockPessimistic, adCmdText
objCleanUpRS.Fields("Password") = Request.Form("password")
objCleanUpRS.Fields("Times") = CStr("1")
objCleanUpRS.Update
objCleanUpRS.Close
Set objCleanUpRS = Nothing
else
%>
<FORM ACTION="changePass.asp" METHOD="post" id=form1 name=form1>
<center><TABLE BORDER=0>
<TR>
Please input a new password to change your temporary password
</TR>
<TR>
<TD ALIGN="right">Password:</TD>
<TD><INPUT TYPE="password" NAME="password"></INPUT></TD>
</TR>
<TR>
<TD ALIGN="right"></TD>
<TD><INPUT TYPE="submit" VALUE="OK" name=Submit></INPUT>
<INPUT TYPE="reset" VALUE="Reset" id=reset1 name=reset1></INPUT>
</TD>
</TR>
</TABLE>
</FORM>
<%
End If
%>
please help me solve this. Thanks:)