dvlnblk
06-26-2003, 03:44 PM
Okay, here is the deal. I am making an asp page that will look through an access database and give each user a random password. Then send out a CDONTS email. I know how to do the CDONTS but I cannot get the random password to work right. I have the password generator but when I loop through the recordset it changes all of the records to the same random password.
Here is the code I have thus far:
<%
While ((Repeat1__numRows <> 0) AND (NOT RS1.EOF))
%>
<%
Dim fs, i, x
Dim strTemp
Set fs = CreateObject("Scripting.FileSystemObject")
For x = 1 to 1
'Get just the filename part of the temp name path
strTemp = fs.GetBaseName(fs.GetTempName)
'Hack off the 'rad'
strTemp = Right(strTemp, Len(strTemp) - 3)
Next%>
uname: <%=(RS1.Fields.Item("email").Value)%> - pass: <%=Response.Write(strTemp)%> <BR><%Set fs = Nothing %>
<% Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_hamid_STRING
MM_editCmd.CommandText = "UPDATE users SET pass = (' " & strTemp & "')"
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
RS1.MoveNext()
Wend
%>
</body>
</html>
<%
RS1.Close()
Set RS1 = Nothing
%>
Can anyone help me with this one, I have spent the whole day trying to figure it out. Thanks, DVL
Here is the code I have thus far:
<%
While ((Repeat1__numRows <> 0) AND (NOT RS1.EOF))
%>
<%
Dim fs, i, x
Dim strTemp
Set fs = CreateObject("Scripting.FileSystemObject")
For x = 1 to 1
'Get just the filename part of the temp name path
strTemp = fs.GetBaseName(fs.GetTempName)
'Hack off the 'rad'
strTemp = Right(strTemp, Len(strTemp) - 3)
Next%>
uname: <%=(RS1.Fields.Item("email").Value)%> - pass: <%=Response.Write(strTemp)%> <BR><%Set fs = Nothing %>
<% Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_hamid_STRING
MM_editCmd.CommandText = "UPDATE users SET pass = (' " & strTemp & "')"
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
RS1.MoveNext()
Wend
%>
</body>
</html>
<%
RS1.Close()
Set RS1 = Nothing
%>
Can anyone help me with this one, I have spent the whole day trying to figure it out. Thanks, DVL