Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Magstripe Verification Code

Status
Not open for further replies.

digipad

Programmer
Jun 17, 2007
7
0
0
US
'm working on a project where I need to validate data from driver licence if its fake to alert and show msgbox
or if its valid to alert and msgbox displaying that is valid.
and the magstrtipe has 2 tracks, here is my tracks

TXSAN ANTONIO^SMITH$JOHN^8301 ANYSTREET THISCITY^?
;8243162777777=091019777777?


when it gets to " ? " in Enters so it start messing up everything, somehow I need to capture the data both tracks, I was thinking to bypass somehow the first enter (" ? ") or?

I need some help here

 
Look into the Instr function. I would use that function to find the location of the ?, then seperate the track data into 2 variables. You'll probably need to use it to seperate other aspects of the track data in order to do your comparison, but that depends on the format of the data your comparing it to. MagTek swipe model 21040104 is compatible with their USBHID ocx that does all this for you. I also like this ocx because when trackdata changes it calls a sub in your code; As opposed to most swipes that are keyboard emulation and require your forms to be ready to accept data into a textbox.

Tom
 
Well I dont think it can be done like this,
because each driver license will be different because of the length of Name Last Name and Driver license number, so there should be another way to do this, but so far I couldnt figure it out

 
All of your issues will be resolved if you use "MagTek swipe model 21040104". Now if you don't control the hardware then instr is perfect for finding the location of say a ? and parsing the string as you choose. instr has nothing to do with string length. I know a few things about reading MSR's but if you choose to not listen to me I can no longer help you.

Tom
 
When you use this paticular Magtek with their ocx it automatically calls this sub "USBHID_CardDataChanged()" when a card is swiped. This eliminates the need for a text box to be ready to accept the data. Then you use things such as USBHID.GetFName etc. that automatically pulls the data you need.



Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top