VBScript runtime(0*800A01A8 and ADODB recordset(0*
HI,
This is the code and i am having trouble updating old password for a new password.When i type the password incorrectly it directs me to the Failurepage.But when i type the new passowrd for the old one.It just doesnt work
SOmebody please help me out soon. i have to submit this work soon.
It gives me two errors:
1)VBScript runtime(0*800A01A8) object required:'DRIVER={Microsoft AC'/CSS/Login/check_password.asp, line 53
2)ADODB recordset(0*800A0CB3) current Recordset does not support updating.This may be limitaetion of the provider or of the selected loacktype./CSS/Login/check_password.asp, line 55
<%
'Dimension variables
Dim adoCon 'Database Connection Variable
Dim strCon 'Holds the Database driver and the path and name of the database
Dim rsCheckUser 'Database Recordset Variable
Dim strAccessDB 'Holds the Access Database Name
Dim strSQL 'Database query sring
Dim strSQLupdate 'Database update sring
Dim strUserName 'Holds the user name
Dim strOldPass 'Holds the user old Paasword
Dim strNewPass 'Holds the user new Password
'Initalise the strUserName variable
strUserName = Request.Form("txtUserName")
strOldPass = Request.Form("txtPassword1")
strNewPass = Request.Form("txtPassword2")
'Check the database to see if user exsits and read in there password
'Initialise the strAccessDB variable with the name of the Access Database
strAccessDB = "users"
'Create a connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Database connection info and driver
'strCon = "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=lnets; DBQ=" & Server.MapPath(strAccessDB)
strCon = "DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=" & Server.MapPath("./users.mdb") & ";"
'Set an active connection to the Connection object
adoCon.Open strCon
'Create a recordset object
Set rsCheckUser = Server.CreateObject("ADODB.Recordset")
'Initalise the strSQL variable with an SQL statement to query the database
//strSQL = "SELECT tblUsers.Password FROM tblUsers WHERE tblUsers.UserID ='" & strUserName & "'"
strSQL = "SELECT tblUsers.UserID,tblUsers.Password FROM tblUsers WHERE tblUsers.UserID ='" & strUserName & "' AND tblUsers.Password ='" & strOldPass & " '"
'Query the database
rsCheckUser.Open strSQL, strCon
'If the recordset finds a record for the username entered then read in the password for the user
If NOT rsCheckUser.EOF Then
rsCheckUser.MoveFirst
'Read in the password for the user from the database
//If (Request.Form("txtPassword1")) = rsCheckUser("Password") Then
//strSQLupdate = "UPDATE tblUsers SET tblUsers.Password = ' " & strNewPass & " ' WHERE tblUsers.Password = ' " & strOldPass & " ' "
//strCon.Execute strSQLupdate
//strCon.execute("UPDATE tblUsers SET tblUsers.Password = ' " & strNewPass & " ' WHERE tblUsers.Password = " & Request.Form("txtPassword2"))
rsCheckUser.Fields("Password")= strNewPass
rsCheckUser.Update
'Close Objects before redirecting
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing
Response.Redirect"success.htm"
else
'Close Objects
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing
Response.Redirect"failure.htm"
//End If
End If
%>
Thanks in advance.
:)
|