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

Filtering out unwanted characters from a mag stripe swipe.

I have a wedge mag stripe reader that I swipe when ask to input
information in a query.
How do I filter the unwanted characters.
Apparently there are two mag stripes that are read every time I swipe
the card.
The first line has the name information and the second line has the
number that I want to use.
The number looks like this when I swipe a card.
%00123478?
I need to filter out the % and the ?
I guess I will also have to filter out the first line of the mag
stripe which has the name info.
Any help will be appreciated.
Thanks

Nov 13 '05 #1
7 2960
If there is ALWAYS 8 characters between % and ?, then use:
Me!DesiredNumber = Mid([SwipedNumber],2,8)
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

<Fr***********@lakeheadu.ca> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
I have a wedge mag stripe reader that I swipe when ask to input
information in a query.
How do I filter the unwanted characters.
Apparently there are two mag stripes that are read every time I swipe
the card.
The first line has the name information and the second line has the
number that I want to use.
The number looks like this when I swipe a card.
%00123478?
I need to filter out the % and the ?
I guess I will also have to filter out the first line of the mag
stripe which has the name info.
Any help will be appreciated.
Thanks

Nov 13 '05 #2
The following is what a sample of the mag info looks like when I do a
swipe. The first line is the name information, which varies in length.
The second line is what I need the access querry to read, but only the
number. The field is set up as text because we want the zero's to show.
How do I modify the line you gave me;
Me!DesiredNumber = Mid([SwipedNumber],2,8)
to also strip off the name info.
Can I use this line as an expression in a query or do I need to put
this into access code.
If I create sample database with a couple of records with the number
0166120 in an ID field, build a query to search for this number using
the mag reader, how would I go about this?

The following is a sample of the mag stripe info.

%FRANK^TEST?
;0166120?

Nov 13 '05 #3
I couldn't remember what the search string function was in Access,
until I saw it in another thread. Here is what I successfully pulled
your ID string out of your sample data with. It uses InStr to find the
leading ";" and the len function to find the trailing bit of the string
to the next "?".

If you may have data after this, just do a search in the string again
for the next "?" and modifiy the MID statement.

DesiredNumber :
Mid([SwipedNumber],InStr([SwipedNumber],";")+1,Len([SwipedNumber])-InStr([SwipedNumber],";")-1)

You can also use a similar routine to pull the name out of the data as
well, looking for the "%", "^", and "?" characters. I would have
figured you could program the swipe reader for exactly what you wanted
and not all the other stuff. Go figure.

Alex.
Fr***********@lakeheadu.ca wrote:
The following is what a sample of the mag info looks like when I do a
swipe. The first line is the name information, which varies in length. The second line is what I need the access querry to read, but only the number. The field is set up as text because we want the zero's to show. How do I modify the line you gave me;
Me!DesiredNumber = Mid([SwipedNumber],2,8)
to also strip off the name info.
Can I use this line as an expression in a query or do I need to put
this into access code.
If I create sample database with a couple of records with the number
0166120 in an ID field, build a query to search for this number using
the mag reader, how would I go about this?

The following is a sample of the mag stripe info.

%FRANK^TEST?
;0166120?


Nov 13 '05 #4
Thanks for all your help Alex.
One problem I'm having is when I swipe the card at the query prompt to
enter information, the query wants to input the info into the table
instead of pulling up a record in the form.
What am I doing wrong?

Nov 13 '05 #5

Frank.Sebe...@lakeheadu.ca wrote:
Thanks for all your help Alex.
One problem I'm having is when I swipe the card at the query prompt to enter information, the query wants to input the info into the table
instead of pulling up a record in the form.
What am I doing wrong?


Why don't you use a form? Have the mag stripe data go into a field on
a form and point the query at the form? You would get better results
with that.

I am to the point where I just use a form for everything. That way the
user can't mess stuff up as much.

Nov 13 '05 #6

Frank.Sebe...@lakeheadu.ca wrote:
Thanks for all your help Alex.
One problem I'm having is when I swipe the card at the query prompt to enter information, the query wants to input the info into the table
instead of pulling up a record in the form.
What am I doing wrong?


Why don't you use a form? Have the mag stripe data go into a field on
a form and point the query at the form? You would get better results
with that.

I am to the point where I just use a form for everything. That way the
user can't mess stuff up as much.

Nov 13 '05 #7
I am using the switchboard form which points to a query then to a form.
If I click on a button on the switchboard that asks me to enter a 7
digit number. It goes to a query and then opens a form with the
appropriate record.
It works if I enter the number manually but when I swipe the number in,
the program thinks the info on the swipe should be input into the
table. It creates a new record instead of bringing up the requested
record.

Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jordan Peterson | last post by:
Gecko renders the left-side #navarea as I intended, but IE6 puts about a 1em vertical gap between the <li> elements: http://maba.org/members I have cleaned up the markup and CSS somewhat, and...
1
by: Erik Hendrix | last post by:
Hi, I have some questions related to stripe sets that I'm hoping someone here can answer. 1) What happens to stripe sets when doing a database restore? Do they stay as is? 2) What happens...
3
by: Frank | last post by:
I'm trying to access my database of records via a mag stripe reader. I've created a querry that prompts me to enter a number. I thought that I might just swipe the mag stripe and the appropriate...
8
by: Tom Warren | last post by:
I've ordered a mag stripe reader for Driver's Licenses but I want to get a jump on raw data parsing. I have the stdAAMVADLIDCardSpecs_092003.pdf which defines the structure of the raw data, but I...
4
by: David Beck | last post by:
I donwnload some files for processing every day that have unwanted characters in them. In VB6 I use the InputB to read in the text and the StrConv. vLinesFromFile =...
1
by: ryan.arasteh | last post by:
Hi, I want to write a c# application to capture the contents of a magnetic stripe card with a card reader attached to the USB or COM port of the PC. Are there any libraries or anything...
2
by: Konrad | last post by:
Hi Can you point examples in .NET of filtering (avoiding) displaying web pages with unwanted content on machine with ie? Thanks Konrad
3
by: et | last post by:
How can I strip out unwanted characters in a string before updating the database? For instance, in names & addresses in our client table, we want only letters and numbers, no punctuation. Is...
3
by: =?iso-8859-1?Q?Johnny_J=F6rgensen?= | last post by:
I've got a textbox where I filter the input in the KeyPress event to allow only certain characters. However, If the user cuts and pastes a text into the textbox, all text is entered - not only...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.