View Single Post
  #2 (permalink)  
Old April 23rd, 2004, 05:21 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Andy,

I can see at least two things that are wrong:

1. You're checking for .EOF, like this:
Code:
if RSuser.eof then
dim oldpassword, newpassword1, newpassword2
EOF means End Of File, and is only true when the user is NOT found. I think you should change that to
Code:
if Not RSuser.eof then
dim oldpassword, newpassword1, newpassword2
2. You're not trying to update the user, but you're creating a new record. Instead of INSERT INTO users, try:
Code:
UPDATE users SET newpassword2 = ' & " newpassword & "' WHERE username...
Other things you can fix:
1. You're using an old skool connection string. Look here for a better version: http://www.able-consulting.com/MDAC/...orMicrosoftJet

2. You should also query for the old password when you're trying to find the user. Otherwise, users can change the password of someone else's account.

HtH,

Imar

---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.


Reply With Quote