Here is what I have used to generate random alpha numeric passwords automatically. The ending result is a 6 character password that is numeric, alpha, numeric, alpha, numeric, alpha. You can add more variables if the password needs to be longer.
<%
'Declare variables
Dim a
Dim b
Dim c
Dim x
Dim y
Dim z
Dim Alphabet
Dim p_password
'Generate 6 random numbers - the first three between 1 and 9, the last three between 1 and 26
randomize
a = int(rnd*9)+1
b = int(rnd*9)+1
c = int(rnd*9)+1
x = int(rnd*26)+1
y = int(rnd*26)+1
z = int(rnd*26)+1
'Assign the last three numbers to letters in the alphabet
Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
'x, y, and z are the alpha characters. So whatever number came up for each variable, we'll take the associated letter in the alphabet string.
x = mid(Alphabet, x, 1)
y = mid(Alphabet, y, 1)
z = mid(Alphabet, z, 1)
'Set password to the 6 variables that were just created. You can put them in whatever order you want. I alternated because there is a chance of spelling inappropriate words if you put all three letters together -- trust me it happened to me!
That's why I alternated them.
p_password = a & x & b & y & c & z
%>
Good Luck
TwoOdd
--------------
Good judgment comes from experience, and experience comes from bad judgment.
-- Barry LePatner
<%
'Declare variables
Dim a
Dim b
Dim c
Dim x
Dim y
Dim z
Dim Alphabet
Dim p_password
'Generate 6 random numbers - the first three between 1 and 9, the last three between 1 and 26
randomize
a = int(rnd*9)+1
b = int(rnd*9)+1
c = int(rnd*9)+1
x = int(rnd*26)+1
y = int(rnd*26)+1
z = int(rnd*26)+1
'Assign the last three numbers to letters in the alphabet
Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
'x, y, and z are the alpha characters. So whatever number came up for each variable, we'll take the associated letter in the alphabet string.
x = mid(Alphabet, x, 1)
y = mid(Alphabet, y, 1)
z = mid(Alphabet, z, 1)
'Set password to the 6 variables that were just created. You can put them in whatever order you want. I alternated because there is a chance of spelling inappropriate words if you put all three letters together -- trust me it happened to me!
p_password = a & x & b & y & c & z
%>
Good Luck
TwoOdd
--------------
Good judgment comes from experience, and experience comes from bad judgment.
-- Barry LePatner