Ciao a tutti.
Nonostante abbia messo un controllo per la verifica della presenza del nr_autorizzazione, (un controllo che se già presente nella tabella Gest genera un secondo codice nr_autorizzazione), ho sempre il problema che anche quando viene generato un secondo codice questo potrebbe essere già presente, causando confusione.
Cosa posso fare?
codice:nr_autorizzazione = request.form("nr_autorizzazione") Sql = "SELECT * from Gest where NR_AUTORIZZAZIONE = '"& NR_AUTORIZZAZIONE &"'" Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open SQL, conn, 3, 3 if NOT objRS.eof then nr_autorizzazione = request.form("nr_autorizzazione") else Function RandomPW(myLength) Const minLength = 6 Const maxLength = 20 Dim X, Y, strPW If myLength = 0 Then Randomize myLength = Int((maxLength * Rnd) + minLength) End If For X = 1 To myLength Y = Int((3 * Rnd) + 1) '(1) Numeric, (2) Uppercase, (3) Lowercase Select Case Y Case 1 Randomize strPW = strPW & CHR(Int((9 * Rnd) + 48)) Case 2 Randomize strPW = strPW & CHR(Int((25 * Rnd) + 65)) Case 3 Randomize strPW = strPW & CHR(Int((25 * Rnd) + 97)) End Select Next RandomPW = strPW End Function strfinal = RandomPW(10) nr_autorizzazione = strfinal end if

Rispondi quotando