<% session("referer")= session("pagina")
session("pagina")= "http://"&request.ServerVariables("HTTP_HOST")&request.Ser verVariables("PATH_INFO")&"?"&request.QueryString( )
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&server.mappath("/database/miodb.mdb")
%><%
Dim caratteri, passgen, carattere, ecc. ecc.
SQL = " SELECT * FROM Utenti Where Confermato=true "
Set RS = Conn.Execute, SQL, 2, 2
If Not RS.EOF Then RS.MoveFirst
Do While Not RS.EoF
ID = RS("ID")
Nome = RS("Nome")
ecc. ecc.
UserID=RS("UserID")
Password=RS("Password")
Confermato=RS("Confermato")
response.Write("La vecchia pass è : ")
response.Write RS("Password")
caratteri = "0123456789abcdefghijklmnopqrstuvwxyz"
Randomize ' inizializza il generatore di numeri casuale
Do Until len(passgen) = 10 ' lunghezza della password
carattere = Int((37 * Rnd) + 1) ' Genero valore casuale compreso tra 0 e z.
passgen = passgen & Mid(caratteri,carattere,1)
Loop
Password=passgen
response.Write(" La nuova pass random è: ")
response.Write(Password)
response.Write("
")
passgen=0000000000
rs.update
RS.MoveNext
Loop
SQL = " UPDATE Utenti Set Nome = '" & Nome & "', Cognome = '" & Cognome & "', Via = '" & Via & "', Civico = '" & Civico & "', CAP = '" & CAP & "', Citta = '" & Citta & "', Provincia = '" & Provincia & "', Stato = '" & Stato & "', Telefono = '" & Telefono & "', RagioneSociale = '" & RagioneSociale & "', CodiceFiscale = '" & CodFiscale & "', PartitaIva = '" & PIva & "', Mail = '" & EMail & "', Password = '" & Password & "', UserID = '" & UserID & "' , Confermato = " & Confermato & " , Rivenditore = " & Rivenditore & " WHERE ID = " & id
Set RS = Conn.Execute(SQL)
Set RS = Nothing
Conn.Close
Set Conn = Nothing
%>