Den här funktionen slumpar fram ett lösenord.
Function CreatePassword(ByVal lngCnt)
Const strPassChars = "abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"
Randomize
CreatePassword = ""
Do while lngCnt > 0
CreatePassword = CreatePassword & Mid(strPassChars, Int(Rnd() * Len(strPassChars)) + 1, 1)
lngCnt = lngCnt - 1
Loop
End Function
Exempel:
strPassord = CreatePassword(5)