954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Barcode Scanner with vb6 question

hallo all..
i have question about connecting barcode scanner to vb6
how to connecting barcode scanner to vb6...
i use usb barcode scanner...
did i must set port or some code in vb6..???
or it works automatically..???
i need some code reference plsss...

belber
Light Poster
31 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

It all depends on what scanner you have, what it will be used for etc....

Have a look at these few links, might help with what you need.

Here , Here or Here .

It seems that you will either have to reference to the drivers or it will be linked to your keyboard automatically, all depends on what you have.

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

It all depends on what scanner you have, what it will be used for etc....

Have a look at these few links, might help with what you need.

Here , Here or Here .

It seems that you will either have to reference to the drivers or it will be linked to your keyboard automatically, all depends on what you have.

hmm...
it's help.., but little...
now, my problem is, how to insert data or serial number after scan with barcode to textbox..

belber
Light Poster
31 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

Show me what code you have so far, the connection, returned values etc.

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

Private Sub Command1_Click()
On Error GoTo errHandler

'FOR WRITING
MSComm1.CommPort = 2
MSComm1.Settings = "9600,N,8,1"
MSComm1.PortOpen = True
MSComm1.Output = "Hey its working" 'Text1.Text
MsgBox MSComm1.OutBufferCount
MSComm1.PortOpen = False

'FOR READING

MSComm1.CommPort = 2
MSComm1.Settings = "9600,N,8,1"
MSComm1.PortOpen = True
MsgBox MSComm1.InBufferCount
MSComm1.InputMode = comInputModeText
'Text1.Text = MSComm1.Input
MsgBox MSComm1.Input
MSComm1.PortOpen = False

errHandler:
If Err.Number <> 0 Then
MsgBox "Error No: " & Err.Number & ", Error Description: " & Err.Description
End If
End Sub

belber
Light Poster
31 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

Are you sure this is the correct approach, the barcode scanners I have used present the data as if it had been typed on the keyboard. ie. you set focus to a text box, scan the barcode and the barcode appears in the text box followed by a CR.

If you want to process the barcode you put some code in the LostFocus event of the text box.

ChrisPadgham
Posting Pro in Training
413 posts since Sep 2009
Reputation Points: 102
Solved Threads: 78
 

hmm....
did barcode scanner work like keyboard..???
so after barcode scanner get the numeric of barcode, the numeric send into text1 ..??

belber
Light Poster
31 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

Correct. Once the textbox you have that must contain the barcode value, use the scanner and it will return the value into the text box.

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

hmm..
thanks.., it's help me more...
so in the case use barcode scanner in usb, i don't need some code...
but in the other i need some code to connect barcode scanner to vb
is that right..??

belber
Light Poster
31 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

The barcode scanner will have come with some drivers, install these and it should work as described above.

ChrisPadgham
Posting Pro in Training
413 posts since Sep 2009
Reputation Points: 102
Solved Threads: 78
 

Generally it "just works". Most USB and ps2 scanners have "keyboard wedges". They are just seen by the OS as a keyboard.

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You