473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

mask a credit card number in table

imrosie
222 100+
Hello,

I'm trying to figure out how to store only the last 4 digits of a credit card number in a 'Payments' table. paymentid is the primary key, not credit card number. I tried using the 'password' in the first field of the input mask, with;;
Then I can't see anything...

does anyone have a simple solution to this. I don't want to 'see' the entire number, just the last 4 when viewing the datasheet or pulling up the old payment record.. thanks

Rosie
Aug 12 '07 #1
7 7981
ADezii
8,834 Expert 8TB
Hello,

I'm trying to figure out how to store only the last 4 digits of a credit card number in a 'Payments' table. paymentid is the primary key, not credit card number. I tried using the 'password' in the first field of the input mask, with;;
Then I can't see anything...

does anyone have a simple solution to this. I don't want to 'see' the entire number, just the last 4 when viewing the datasheet or pulling up the old payment record.. thanks

Rosie
  1. Hide the Credit Card Column in Table Datasheet View.
  2. Create a Query which exposes only the last 4 digits of the Credit Card in a Calculated Field as indicated below:
    Expand|Select|Wrap|Line Numbers
    1. Card: Right([Credit Card],4)
  3. View the Query, not the Table.
Aug 12 '07 #2
missinglinq
3,532 Expert 2GB
Hey, Rosie! You say you only want to store the last four digits of the CC number in your table, but that wouldn't do you much good, would it? I would think, from your overall post, that you need to store the entire CC number, but you only want the last four digits "readable" in your table.

What I'd do, I think is have separate fields for the first part of the CCN, which you want hidden (call it CCHidden) , and the second part, which you want to be able to read (call it CCShow.) In the table definition of the first, to be hidden field (CCHidden) make the Input Mask Password.

Next, make a query using the Query Design View. After placing all the fields in the Query Grid go into a blank field and in the Field box enter:

CCEntire: CCHide & CCShow

If you run the query you'll see both halves of the CCN and the entire CCN. The entire CCN will be in plain text in the query, but stored in the table will only be the two halves, with the first half unreadable.

You can now use the query as the Record Source for your table, and if you want to compare a CCN that the user enters against the stored CCN you'd do something like this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub CompareCCN_AfterUpdate()
  2.  If CompareCCN <> CCEntire Then 
  3.   MsgBox "Doesn't match!"  'or whatever you want to do if no match
  4.  End If
  5. End Sub
  6.  
This will compare the entered CompareCCN against the query field CCEntire, then you can take whatever action. The important thing is, the CCEntire, which is all in plain text, doesn't have to appear on the form! The fact that it's part of the query allows you to compare the entered number to CCEntire.

If you're playing around in the world of credit cards, you might want to take a look at this sample db from Allen Browne. He has routines for validting CCNs>

http://allenbrowne.com/CCValid.html

Linq ;0)>

Sorry, ADezii, got distracted mid post!
Aug 12 '07 #3
ADezii
8,834 Expert 8TB
Hey, Rosie! You say you only want to store the last four digits of the CC number in your table, but that wouldn't do you much good, would it? I would think, from your overall post, that you need to store the entire CC number, but you only want the last four digits "readable" in your table.

What I'd do, I think is have separate fields for the first part of the CCN, which you want hidden (call it CCHidden) , and the second part, which you want to be able to read (call it CCShow.) In the table definition of the first, to be hidden field (CCHidden) make the Input Mask Password.

Next, make a query using the Query Design View. After placing all the fields in the Query Grid go into a blank field and in the Field box enter:

CCEntire: CCHide & CCShow

If you run the query you'll see both halves of the CCN and the entire CCN. The entire CCN will be in plain text in the query, but stored in the table will only be the two halves, with the first half unreadable.

You can now use the query as the Record Source for your table, and if you want to compare a CCN that the user enters against the stored CCN you'd do something like this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub CompareCCN_AfterUpdate()
  2.  If CompareCCN <> CCEntire Then 
  3.   MsgBox "Doesn't match!"  'or whatever you want to do if no match
  4.  End If
  5. End Sub
  6.  
This will compare the entered CompareCCN against the query field CCEntire, then you can take whatever action. The important thing is, the CCEntire, which is all in plain text, doesn't have to appear on the form! The fact that it's part of the query allows you to compare the entered number to CCEntire.

If you're playing around in the world of credit cards, you might want to take a look at this sample db from Allen Browne. He has routines for validting CCNs>

http://allenbrowne.com/CCValid.html

Linq ;0)>

Sorry, ADezii, got distracted mid post!
Not a problem, ling. I like your solution better anyway.
Aug 12 '07 #4
imrosie
222 100+
Not a problem, ling. I like your solution better anyway.
Thanks missinglinq,

I'm going off to try this now. You're right...I do need to store the entire number, but don't want anything but the last 4 digits to show, that is what I meant...slip of the verbiage.

Anyway, I'll post back when I get this going. thanks too ADezii,
since you liked Missinglinq's solution, that's what I'll do.
Rosie
Aug 12 '07 #5
ADezii
8,834 Expert 8TB
Thanks missinglinq,

I'm going off to try this now. You're right...I do need to store the entire number, but don't want anything but the last 4 digits to show, that is what I meant...slip of the verbiage.

Anyway, I'll post back when I get this going. thanks too ADezii,
since you liked Missinglinq's solution, that's what I'll do.
Rosie
Always a pleasure to do business with a lady. I'm quite sure that ling feels the same way!
Aug 12 '07 #6
imrosie
222 100+
Always a pleasure to do business with a lady. I'm quite sure that ling feels the same way!
ADezii, what kind words,,,,,'a lady'...I try always to be that. Anyway, I've spoken with my Order dept. regarding the storing of the ccnum....they actually don't want to store the full number because of security.

What they really need is a way to capture the last 4 digits for preparing the invoice. Although this isn't complete, would something like this in the control work?:

Expand|Select|Wrap|Line Numbers
  1. ccnum = right$(trim$(ccnum),4)
I'd like to have this show up on the receipt:****-****-****-1234

Better suggestions are certainly welcome. thanks in advance,
Rosie
Aug 13 '07 #7
missinglinq
3,532 Expert 2GB
Not be obtuse, as I've never worked in commerce, but if the CCN isn't stored anywhere, how is the customer charged? And yes, your code should pull the last four characters of any srtring.

Linq ;0)>

FYI, according to a report I saw a month or two ago, a recent study showed that over 95% of all theft of CCNs didn't come thru theft by computer but rather the old fashioned way, by someone walking off with hard copies!
Aug 13 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Simon Wigzell | last post by:
My client wants to have credit card information fields on his forms for his website visitors to be able to buy his wervices by credit card. The credit card info - Brand, number and expiry date will...
10
by: dries | last post by:
A friend of mine has a problem with his credit card validation routine and it is probably a simple thing to solve but I cannot find it. It has to do with the expiry dates. What happens is that as...
6
by: Arne | last post by:
What would be a good component for processing credit cards? (I am not using commerce server.) Would I need to encrypt the credit card column in the database?
4
by: Jerry Camel | last post by:
I'm writing and ASP.net app using vb .net. I need to interact with a credit card reader. I have one that sits inline with the keyboard. Works great, except for the fact that no matter what field...
12
by: Jerry Camel | last post by:
Not sure if this is a good place to post this... I'm writing and ASP.net app using vb .net. I need to interact with a credit card reader. I have one that sits inline with the keyboard. Works...
1
by: veg_all | last post by:
I am often surprised to see many websites require that the credit card not be entered with any spaces or dashes. This is very trivial to remove those characters that I wonder about the security of...
1
by: Jon Peck | last post by:
I'm largely self-taught (so hardly an expert) in Access 2002. I'm wondering if it's possible to have a conditional input mask on a field in a form. My database keeps track of people who register...
3
by: xian2 | last post by:
Hi, I am trying to validate a credit card expiry date so it is no later than three years ahead of today's date. I am OK with the validation as far as Date()+1096 which is the maximum number of days...
1
by: securedcardss | last post by:
http://card.2youtop.info secured credit card card credit instant secured card cash credit secured card
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.