473,396 Members | 1,671 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,396 software developers and data experts.

Credit card number search within a text filed

hi, looking for some help. I need to search an entire db for 16 digit credit card numbers, and identify which record it's found in.

The below successfully find a 16 digit number, but only when found on it's own.

is there a way to change this code so that It can search through an entire DB or at least an entire text field and identify the 16 digit string?

Expand|Select|Wrap|Line Numbers
  1. Dim SQL As String, qdf As DAO.QueryDef
  2.  
  3.  
  4. Set qdf = CurrentDb.QueryDefs("cardsearch")
  5.  
  6. qdf.SQL = "SELECT Id, case_overview " & _
  7.     "From case_data " & _
  8. "WHERE  LEN(case_overview) = 16 AND case_overview NOT Like '%[0-9]%'"
  9.  
  10. Me.List194.RowSource = "cardsearch"
  11.  
  12. DoCmd.Requery "list194"
  13.  
thanks
Martin
Apr 8 '15 #1
3 1218
zmbd
5,501 Expert Mod 4TB
What I suggest you do is on your open database, create a query that returns your expected results. Once you have that query working by hand, then you can switch to SQL view from the GUI and cut and paste the SQL into the VBE.

From there you can clean up the SQL as needed (sometimes MSA tosses in extras) and modify to allow for variables.

Z
Apr 8 '15 #2
Rabbit
12,516 Expert Mod 8TB
Are you looking to extract any 16 digit number from any and all fields? For that you need to loop through every table and every field and use something like a regular expression to extract the matches and put them in another table.
Apr 8 '15 #3
zmbd
5,501 Expert Mod 4TB
Rabbit
Normally I'd agree... but it seems to me that OP is attempting to populate a listbox and couldn't that could be done by setting the SQL properly?
Apr 9 '15 #4

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

Similar topics

1
by: Amy B | last post by:
Hi, A co-worker is creating a vb.net web application which uses the CryptKeeper.dll to encrypt credit card numbers into a sql database. It is my job to pull these encrypted numbers and use the...
1
by: penguin732901 | last post by:
I am trying to print a contract for a customer specifying use of their credit card number. For some odd reason the number is being rounded. I checked - it's a text field. On the other hand, I...
6
by: Grant | last post by:
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...
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...
3
by: Tobiah | last post by:
I browsed this subject and thought I might use the 'AES' cypher scheme to do this. Would this be a good choice? I came across a "Python Cryptography Toolkit" ...
3
by: gigs68 | last post by:
What script would I need to write (vb.net) to validate a credit card number's length and first digit input to a text box (i.e., Visa Length=16 digits, first digit starts with a 4)? Thanks Bryan
7
imrosie
by: imrosie | last post by:
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...
1
by: anilraja | last post by:
how to search within text using vbscript?
6
by: Ed Light | last post by:
Is it possible to make a credit card number input field that is ignored by the browser's form entry history/auto fill, like passwords are, but without the asterisks? -- Ed Light Better World...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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.