Reset strPass to be vbNullString or "" at the start of each loop:
'Loop through the records.
Do Until RS.EOF
'No need to reset the password starts value if we are doing assignment only.
'Determine the correct length and fill with stars.
strPass = String(Len(RS.Fields("Password").Value), "*")
'Write the string to the browser
Response.Write "<tr><td>" & RS.Fields("UserID").Value & "</TD><TD>" &
strPass &
"</TD><TD>" & RS.Fields("Email").Value & "</td></tr>"
RS.MoveNext
Loop
NB: You should also be storing the password 'encrypted' in the DB - depends
on how paranoid you are!
Chris.
Alex,
This works well, but now I have the following problem.
I have the following code, but all the passwords listed as '*', are
displaying the same number of characters even though they should display
different numbers of characters..
My code....
_____________________________________________
else
For i = 1 to Len(RS("Password"))
strPass = strPass & "*"
Next
response.write blah blah blah....
do until RS.EOF
response.write "<tr><td>" & RS("UserID") & "</TD><TD>" & strPass &
"</TD><TD>" & RS("Email") & "</td></tr>"
RS.movenext
loop
_________________________________________
If I take the For loop out of the Do loop then it lists the passwords as
the first one only...I understand this. If it is left in the do loop, it
just adds the characters on for each user, so, it displays longer &
longer passwords...
I want it to display the number of characters in each users password as
follows:
User 1, password: ****
User 2, password: ********
User 3, password: ******
not...where all passwords shown are for user1
User 1, password: ****
User 2, password: ****
User 3, password: ****
or, where it just appends on to the end each loop
User 1, password: ****
User 2, password: ********
User 3, password: ************
What is the solution.....thanks.
David