Here is an access function for generic card testing which might help you
also.
Function CreditCardCheckDigit(strCreditCard As String) As Boolean
Dim intLength As Integer
Dim intEvenSum As Integer
Dim intOddSum As Integer
Dim i As Integer
CreditCardCheckDigit = False
On Error GoTo Errorhandler
intEvenSum = 0
intOddSum = 0
intLength = Len(strCreditCard)
If intLength Mod 2 = 1 Then strCreditCard = "0" & strCreditCard ' for
amex
For i = 1 To intLength - 1
If i Mod 2 = 0 Then
intEvenSum = intEvenSum + CInt(Mid(strCreditCard, i, 1))
ElseIf CInt(Mid(strCreditCard, i, 1)) = 9 Then
intOddSum = intOddSum + 9
Else
intOddSum = intOddSum + CInt(Mid(strCreditCard, i, 1)) * 2 Mod 9
End If
Next i
If Right(CStr(1000 - (intEvenSum + intOddSum)), 1) =
CInt(Right(strCreditCard, 1)) Then
CreditCardCheckDigit = True
End If
Exit Function
Errorhandler:
MsgBox "Credit Card Check Digit function failed."
End Function
"Grant" <Gr***@nutrikids.com> wrote in message
news:u$**************@tk2msftngp13.phx.gbl...
Does any one know how to check the algorithm of the credit card number
that was entered in the text box? I want to be able to make sure the users
enter correct credit card number since we will process it manually via phone. I
want this to be done on the server side behind the code in ASP.Net. Thanks