
Originally Posted by
micky
koi baat nahi, chalne lagegi, chinta mat kar
You need to check if your recordset has a record or not, before you can read its value like rs("password").
So add such code
Code:
If NOT rs.BOF and NOT rs.EOF
If oldpassword = "" Or newpassword = "" Then
Response.Write "Make sure password is valid and fill all the fields please!"
ElseIf rs("password") <> oldpassword Then
Response.Write "Wrong password inserted!"
ElseIf newpassword <> confirmpassword Then
Response.Write "Confirm password and new password are not the same!"
ElseIf oldpassword = newpassword Then
Response.Write "Old password and new password are the same!"
Else
sql = "UPDATE mem SET password = '" & newpassword & "' WHERE " _
& "username = '" & Request.Form("username") & "'"
conn.Execute(sql)
Response.Write "Your Password has been changed!"
End If
End If
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
'End If
you mean? Code:
If NOT rs.BOF and NOT rs.EOF Then
i have done this and no errors come up but it doesnt seem to change the password.. khalas khatum hoi gya!!!
Centurion, July 14th, 2009 08:17 AM
Bookmarks