|
|

Generating a random Password
If you wish to create a random character string, then you will need to create a small function to do this. The way shown below is the easiest way that I have found of doing this:
Public Function fPasswordGenerator() As String
On Error GoTo E_Handle
Dim intLoop As Integer
Dim strChar As String
Dim strDummy As String
strChar = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
Randomize
For intLoop = 1 To 6
strDummy = strDummy & Mid(strChar, Int(Rnd * Len(strChar)) + 1, 1)
Next intLoop
fPasswordGenerator = strDummy
fExit:
On Error Resume Next
Exit Function
E_Handle:
MsgBox Err.Description & vbCrLf & "fPasswordGenerator", vbOKOnly + vbCritical, "Error: " & Err.Number
Resume fExit
End Function
|
The characters that are included in the password can be modified by amending the characters in the strChar variable, and the length of the generated password can be changed by modifying the loop counter.
Top
HOME |
NEW |
TABLES |
QUERIES |
FORMS |
REPORTS |
GENERAL |
API |
DOWNLOADS |
TUTORIAL |
RESOURCES
E-MAIL
Copyright & Disclaimer
|
| |