|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
||||
|
||||
|
Code:
If Request("OldPassword") = objRS("fldPassword") THEN
objRS("fldPassWord") = Request("NewPassword")
objRS.Update
The above code is meant to change the user's password, if the value of "OldPassword" entered into the form matches the current value of the password in the database. If this is true, then the recordset updates to the new password entered in the form. If it is not true, the message "The passwords don't match" comes up. My problem is that even when "OldPassword" and "fldPassword" are the same, I still get the "don't match" message. I have successfully used the update statement with different conditions, and I have done response.write to obtain the values of "OldPassword" and "fldPassword", and they are indeed the same thing. (The current password is "sloppy", if that helps). I'm sure this is some minor little thing that I'll be kicking myself for not catching, but I've stared at the code long enough that its all blurring together in my head. Any help would be great ![]() Thanks in advance.
__________________
--Dave-- U2kgSG9jIExlZ2VyZSBTY2lzLCBOaW1pdW0gRXJ1ZGl0aW9uaXMgSGFiZXM= |
|
#2
|
|||
|
|||
|
I'd start by doing this:
<% Dim strOldPassword strOldPassword = Trim(Request("OldPassword")) 'FOR DEBUG ONLY 'Response.Write "-->" & strOldPassword & "<--<hr>" 'Response.End If LCase(Trim(strOldPassword)) = LCase(Trim(objRS("fldPassword"))) THEN Response.Write "The same" Else Response.Write "Not the same" End If %> Then see if that works, if it doesn't then that is very strange... But like you said, you probably already tried that right? Hope this helps! Sincerely Vlince |
|
#3
|
||||
|
||||
|
doh
It was the Trim() that fixed it. I keep forgetting about extra spaces and such
Thanks Vlince, you saved me some weeping and gnashing of teeth ![]() |
|
#4
|
|||
|
|||
|
Hey no problem, ever since I wasted 2 days on a stupid Access reserved word I don't take any chances.
I always use Trim() and Clng() even if I know its an INT, I'll be using Clng() for the rest of my life hehe... These are habits I got after wasting so many time on stuff like that! Vlince |
|
#5
|
|||
|
|||
|
wait, why is there extra spaces in a request call or the record set?
|
|
#6
|
||||
|
||||
|
Don't know. Didn't even bother finding which had the extra spaces. Computers are a strange and fickle mistress
![]() |
|
#7
|
|||
|
|||
|
haha, ok, just wanted to make sure i wasn't missing out on a big flaw all these years.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > pesky logic error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|