how about this
I created this in Access but the VBA is the same for ASP
---------------------------------------------
Public Function CheckForAlphaNumeric(Password)
Dim WhichLetter As String
Dim WeGotaCapitaletter, WeGotaLowerletter, WeGotanumber As Boolean
Dim a As Integer
For a = 1 To Len(Password)
WhichLetter = Mid(Password, a, 1)
If Asc(WhichLetter) >= 65 And Asc(WhichLetter) <= 93 Then
WeGotaCapitaletter = True
ElseIf Asc(WhichLetter) >= 97 And Asc(WhichLetter) <= 122 Then
WeGotaLowerletter = True
ElseIf Asc(WhichLetter) >= 48 And Asc(WhichLetter) <= 57 Then
WeGotanumber = True
End If
Next
If WeGotaCapitaletter = True And WeGotanumber = True Then
MsgBox "We have a number and a letter"
ElseIf WeGotanumber = True And WeGotaLowerletter = True Then
MsgBox "We have a number and a letter"
Else
MsgBox "Please make sure you have a Number and a Leter in your password"
End If
End Function
-----------------------------------------
DougP, MCP
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.