SLCreditCard is an ActiveX component that can be used to validate credit card numbers and check expiration dates of credit cards. The component can also determine the type of credit card by examining the credit card number. The component recognizes the following four card types: VISA, American Express, MasterCard and Discover. But the component can also make a general credit card number check and check expiration date to other credit card types.
Dim X As Long
SLCreditCard1.Number = "4111 1111 1111 1111"
SLCreditCard1.ExpirationDate = "01/09"
SLCreditCard1.CardType = 1 ' VISA
X = CC_OK
' Check credit card number
If SLCreditCard1.IsNumberValid() = False Then
X = CC_INVALID_NUMBER
' Check expiration date
If SLCreditCard1.CheckExpirationDate() <> 1 Then
If SLCreditCard1.CheckExpirationDate() = 0 Then
X = CC_OUTOFDATE
X = CC_ILLEGAL_DATE
< Go back