Random Password

C

Chris Nebinger

This one will return a case sensitive password:

Function RandomPassword()
Dim intRandom As Integer
Dim strPassword As String
Randomize Timer
Do Until Len(strPassword) = 8
intRandom = Int(Rnd(1) * 75) + 47
Select Case intRandom
Case 48 To 57, 65 To 90, 97 To 122
strPassword = strPassword & Chr$(intRandom)
End Select
Loop
RandomPassword = strPassword
End Function


Chris Nebinger

-----Original Message-----
How can i generate random passwords, 8 characters in
length, combination of numbers and letters? I need to do
this first in an update query to assign approximately 5500
passwords. Then, I will make a button that has this code
in it so that when the button is clicked, the password is
generated.
 
G

Guest

Nevermind to my last response, I figured that part out. I'm getting the same password for everyone though. How can i modify it for my update query

----- Chris Nebinger wrote: ----

This one will return a case sensitive password

Function RandomPassword(
Dim intRandom As Intege
Dim strPassword As Strin
Randomize Time
Do Until Len(strPassword) =
intRandom = Int(Rnd(1) * 75) + 4
Select Case intRando
Case 48 To 57, 65 To 90, 97 To 12
strPassword = strPassword & Chr$(intRandom
End Selec
Loo
RandomPassword = strPasswor
End Functio


Chris Nebinger

-----Original Message----
How can i generate random passwords, 8 characters in
length, combination of numbers and letters? I need to do
this first in an update query to assign approximately 5500
passwords. Then, I will make a button that has this code
in it so that when the button is clicked, the password is
generated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top