By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,987 Members | 1,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,987 IT Pros & Developers. It's quick & easy.

Read information from magnetic card reader and display in various textboxes

100+
P: 274
Hi everyone
I am working on a project and have to connect mx3-usb magnetic card reader with buildin software installation facility. I want to collect customer information by their driving licence. When I scan a card it display all information in one text box that looks like this

%bcsurrey^asif, farhana^bsmt-16568 90a ave$surrey bc v6v 2p1^?
;6360283892537=080819801006=?

I extracted user's licence number by using L and R trim function. My target is to extract and display all fields in their rexpective fields leaving unnecessary fields.I don't think that using trim function to seperate these fields is right choice.
I can't find any example about it. can someone help me do this? is there any ActiveX control or function to do that.
any idea help will be greatly appreciated.

thanks
Sep 17 '07 #1
Share this Question
Share on Google+
35 Replies


debasisdas
Expert 5K+
P: 8,127
As you have posted a question in the articles section it is being moved to Visual Basic Forum

MODERATOR
Sep 17 '07 #2

Expert 5K+
P: 8,434
Use the Split() function.
Sep 18 '07 #3

100+
P: 274
Use the Split() function.
thnaks killer
but there are more than one filter string in the given string. What I should about it. Does filter support this?
Sep 18 '07 #4

Expert 5K+
P: 8,434
there are more than one filter string in the given string. What I should about it. Does filter support this?
Can you tell us in detail what the format is? For instance, is "^" the delimiter between pieces of information, or what?
Sep 18 '07 #5

100+
P: 274
%bcsurrey^asif, farhana^bsmt-12728 96a ave$surrey bc v3v 2a1^?
;6360287293137=080819821106=?

where
b/w
bcsurrey issuing authority length not fix
asif,farhana driver's name length not fix driver can have middle name
12728 96a ave address neither length not format is fixed
surrey city length not fix
bc province fix length
v4v 2a1 postal code length fix
636028 I don't know......... may be driving class 87293137 licence no ............... length fix
0808 expiry date length fix
19821106 is the dob of driver length fix

I want to extract information in bold. there are a number of fields having fix length but not all.
thanks
Sep 18 '07 #6

Expert 5K+
P: 8,434
Since the lengths are not all fixed, you will obviously have to handle them as delimited fields. But are you saying they don't have consistent delimiters? It looks as though there are at least two different delimiter characters, "^" and ";". Does that sound right?
Sep 19 '07 #7

100+
P: 274
delimiters are consistent they are not changing at all. I am really uncertain if I can ever do this. I can't find any information on this topic at all. If you can write me a few lines how I can use SPLIT() to extract required information. I think I need to use combination of SPLIT and TRIM functions. Thanks for your interest
Sep 19 '07 #8

100+
P: 274
Hi everyone,
Today I finished the module to extract information by a magnetic card reader. I designed it to read vendors' driving licences and extracted desired information from there, and displayed it in their respective text boxes.

It was fun doing this. I used several combinations of LTRIM(), RTRIM(), SPLIT(), UCASE(), MID().
I used MX3 card reader - it proved very flexible and does not require any special software. If anyone ever needs help in programming for magnetic card reader, I'll be happy to assist.

Kind Regards.
Jan 1 '08 #9

Expert 5K+
P: 8,434
That's great news, creative1. :)

Sorry we seem to have left you hanging on this one. With so much going on, it's easy to lose track of a thread. Don't be scared to drop in an occasional reminder.
Jan 1 '08 #10

P: 1
Hi,creative1
No need for all these combinations ( LTRIM(), RTRIM(), SPLIT(), UCASE(), MID().)
You may use only one Split() function to claim all the split strings.
Here is a code that may help.

Expand|Select|Wrap|Line Numbers
  1. Dim myreaderinfo As String
  2. Dim wd() As String
  3. myreaderinfo = 'put your incoming information here.
  4. wd() = Split(myreaderinfo, "^")
  5. text1.text = wd(0)
  6. text2.text = wd(1)
  7. text3.text = wd(2)
  8. 'and so on .......
  9. 'but remember to count the ^s because the textboxes should be the same number as the splits.
Thanks
Jan 3 '08 #11

P: 10
Hi everyone,
Today I finished the module to extract information by a magnetic card reader. I designed it to read vendors' driving licences and extracted desired information from there, and displayed it in their respective text boxes.

It was fun doing this. I used several combinations of LTRIM(), RTRIM(), SPLIT(), UCASE(), MID().
I used MX3 card reader - it proved very flexible and does not require any special software. If anyone ever needs help in programming for magnetic card reader, I'll be happy to assist.

Kind Regards.
Hi! I am struggling with the same issue, I have a mag card reader and Would like to know how I can make it output information into textboxes. Thank you for the help!!!
Jan 9 '08 #12

100+
P: 274
Which magnetic card reader you are using?
Are you able to read information from your card or not?
Do yo have a software for your card reader?
If yes; How it looks like?
Which card you are reading? Is this the only card that will be used?
If knowing all that I can help you.

Kind Regards
Jan 9 '08 #13

P: 10
Which magnetic card reader you are using?
Are you able to read information from your card or not?
Do yo have a software for your card reader?
If yes; How it looks like?
Which card you are reading? Is this the only card that will be used?
If knowing all that I can help you.

Kind Regards
Hi! Thank you much for the reply! I am using a card reader (MSR210U series) basic black rectangular reader. If I open note pad and scan a driverslicence, it spits all data not in nice way, something like this:
%414142452555555 E 7772777 ?
;525252678272627=9992828288=?
%TXDallasMoore$James^654 Highland ROAD$^?

- The card reader didn't come with a software, I just plug it to a usb port
- I am gonna eventually want to use credit card with it as well. Thank you!
Jan 9 '08 #14

P: 1
Hi! Thank you much for the reply! I am using a card reader (MSR210U series) basic black rectangular reader. If I open note pad and scan a driverslicence, it spits all data not in nice way, something like this:
%414142452555555 E 7772777 ?
;525252678272627=9992828288=?
%TXDallasMoore$James^654 Highland ROAD$^?

- The card reader didn't come with a software, I just plug it to a usb port
- I am gonna eventually want to use credit card with it as well. Thank you!
1st - change all %^?; to space
2nd - and then slipe(string,space)
3rd - read the array a take the value that you want
Jan 9 '08 #15

P: 10
1st - change all %^?; to space
2nd - and then slipe(string,space)
3rd - read the array a take the value that you want
Hi! I don't know how to put data from the card reader into a variable to process it.Basically I don't know how to make communication between the card reader and the form.
Jan 9 '08 #16

Expert 5K+
P: 8,434
Hi! I don't know how to put data from the card reader into a variable to process it.Basically I don't know how to make communication between the card reader and the form.
If it pops into Notepad automatically, chances are it will turn up as though the user typed it.
Jan 10 '08 #17

Expert 5K+
P: 8,434
2nd - and then slipe(string,space)
What the heck does "slipe" mean?
Jan 10 '08 #18

P: 10
Which magnetic card reader you are using?
Are you able to read information from your card or not?
Do yo have a software for your card reader?
If yes; How it looks like?
Which card you are reading? Is this the only card that will be used?
If knowing all that I can help you.

Kind Regards
Hi! Here is my email: [Removed] if you could please send me a sample code. Thanks!
Jan 10 '08 #19

Expert 5K+
P: 8,434
Sorry etalon25, site posting guidelines prohibit the posting of personal contact info. This is to protect you against scammers and spammers who may scan the forum.

If you want people to contact you "off-list" they can do so by clicking your ID to go to your profile, and using the options there to send a Private Message, e-mail, instant message or whatever. Depending on what options you have switched on at the time, of course.
Jan 10 '08 #20

P: 10
Sorry etalon25, site posting guidelines prohibit the posting of personal contact info. This is to protect you against scammers and spammers who may scan the forum.

If you want people to contact you "off-list" they can do so by clicking your ID to go to your profile, and using the options there to send a Private Message, e-mail, instant message or whatever. Depending on what options you have switched on at the time, of course.
Okay! I didn't know that. Sorry about that. Because I don't get notified of new replies I thought I 'd give my email. Thanks!
Jan 10 '08 #21

Expert 5K+
P: 8,434
Okay! I didn't know that. Sorry about that. Because I don't get notified of new replies I thought I 'd give my email. Thanks!
The site should notify you of replies, as far as I know. But it is going through a number of changes, so maybe this feature is down.

I'll ask the Admins.

(Note, it might depend on your "subscription" type for the thread, too.)
Jan 10 '08 #22

P: 10
The site should notify you of replies, as far as I know. But it is going through a number of changes, so maybe this feature is down.

I'll ask the Admins.

(Note, it might depend on your "subscription" type for the thread, too.)
I am still struggling with the card reader, Can anyone please help!!
Jan 10 '08 #23

Expert 5K+
P: 8,434
I am still struggling with the card reader, Can anyone please help!!
What happens if you simply run your application and give it the focus, say in a textbox, then swipe a card - anything?


As for the notifications, apparently there has been a bug in that for some time. I think you can work around it by changing the notification type, because it defaults to None. I'm assured this will soon be fixed.
Jan 11 '08 #24

100+
P: 274
hi
sorry for late reply I was busy and couldn't send you ;
here is logical flow of the program:
Add a command button call it ScanCard
on the click of the button set control to a textbox say text1.text,
display a message for the user to swipe the card;
at this step card will sent its information to text1.text
now its your turn to play the trick with your string;
once you will finish your trick minimize the size of text1.text and hide it behind you ScanCard command button; so people may not see whats is happening behind the scene.

Regards
Jan 11 '08 #25

100+
P: 274
Your second step for progrmming to extract useful information from your string. First of all decide what you want from this string and then know what is what in this string.

%414142452555555 E 7772777 ?
;525252678272627=9992828288=?
%TXDallasMoore$James^654 Highland ROAD$^?



654 Highland ROAD$^? Address
TXDallasMoore$James is name

I can't pick other
so its your turn to step ahead.
Kind Regards
Jan 11 '08 #26

Expert 5K+
P: 8,434
If that's "real" personal info we should edit it out.
Jan 11 '08 #27

100+
P: 274
Not sure about etalon25's posts but all data that I show you guys in my entries is fake. I know it could be critical for someone.
Jan 11 '08 #28

P: 10
If that's "real" personal info we should edit it out.
That fake data, i just came out with numbers and stuff.
Jan 12 '08 #29

P: 10
hi
sorry for late reply I was busy and couldn't send you ;
here is logical flow of the program:
Add a command button call it ScanCard
on the click of the button set control to a textbox say text1.text,
display a message for the user to swipe the card;
at this step card will sent its information to text1.text
now its your turn to play the trick with your string;
once you will finish your trick minimize the size of text1.text and hide it behind you ScanCard command button; so people may not see whats is happening behind the scene.

Regards
Hi! Thank you for the reply, ididn't event get notification. So, it's that simple, I don't have to mess with HID classes or any of that, just set focus on the textbox , so people will see text1.text the first time?
Jan 12 '08 #30

P: 10
Your second step for progrmming to extract useful information from your string. First of all decide what you want from this string and then know what is what in this string.

%414142452555555 E 7772777 ?
;525252678272627=9992828288=?
%TXDallasMoore$James^654 Highland ROAD$^?



654 Highland ROAD$^? Address
TXDallasMoore$James is name

I can't pick other
so its your turn to step ahead.
Kind Regards
Hi! How do you hide textbox behind the button, I can't get it to hide.
Jan 12 '08 #31

Expert 5K+
P: 8,434
Hi! How do you hide textbox behind the button, I can't get it to hide.
I think if you simply set their .Top and .Left properties the same, that would do the trick. You may also have to play with which one is in front of the other, I suppose. If necessary, look up Zorder in the doco.
Jan 13 '08 #32

100+
P: 274
hi
what I do is, I minimize the size of textbox to make it smaller than the size of commandbutton and then bring it over the button and set Set Bring to front (for button) (after you finish the programming)
No big trick
Jan 13 '08 #33

Expert 5K+
P: 8,434
what I do is, I minimize the size of textbox to make it smaller than the size of commandbutton and then bring it over the button and set Set Bring to front (for button) (after you finish the programming)
Note, you could also just use "Send to Back" on the textbox - same effect. :)

Personally, I've always preferred to leave controls like this where I can see them, and pop a bit of code in somewhere like the Form_Load event to move them.

By the way, you can also get a similar effect by simply moving the textbox off the form. For example, move it to negative coordinates. Or just past the right or bottom of the form.
Jan 13 '08 #34

100+
P: 274
Killer42
great tip? I am impressed
Jan 14 '08 #35

Expert 5K+
P: 8,434
Killer42
great tip? I am impressed
Thanks. But if you do move things just off the visible form, remember to consider the possibility of changing screen resolution.
Jan 15 '08 #36

Post your reply

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