Validation

shariefoo

Registered User.
Local time
Today, 23:13
Joined
Sep 29, 2003
Messages
65
Hi All,

Can anyone please help me ? I have a password feild and i want to validate it when a users enters his/her password..

The validations are must be 6 or longer. Must have at least 1 number digit. Must have atleast one charector (like @ or $).

I know how to do one validation which is must be over 6 and i can also do a validation to see if left blank thats no problem. The number and Char is a probelm..

Help please ?
 
Try running:
Code:
Function ValidatePass(SomePass As String) As Boolean
Dim I As Integer
Dim Numbers As Boolean
Dim Specials As Boolean
Dim Smalls As Boolean
Dim Caps As Boolean
Numbers = False
Specials = False
Smalls = False
Caps = False
ValidatePass = False
If Len(SomePass) < 6 Then Exit Function
For I = 1 To Len(SomePass)
    Select Case Asc(Mid(SomePass, I, 1))
        Case 48 To 57  ' 0 to 9
            Numbers = True
        Case 97 To 122 ' a to z
            Smalls = True
        Case 65 To 90  ' A to Z
            Caps = True
        Case Else      ' anthing else
            Specials = True
    End Select
Next I
If Numbers And Specials And Caps And Smalls Then ValidatePass = True
End Function
Regards

The Mailman
 
Thank You

Thanx Mailman..
 
Another happy customer :)

Please send 10 euro's to... ;)

Regards
 

Users who are viewing this thread

Back
Top Bottom