visual basic 6.0 procedure for reading a barcode scanner


Thread Starter

R McGill

I'm working on a new application for Bar Codes and need to find some code (Visual Basic 6.0) to read a scanner into a variable.

BobnGeri10 [at]


Piotr Kowalski

Basically, there are two types of barcode scanners:
- with USB, PS2 interface,
- with RS232C interface.

In the first case the scanner works just like an additional keyboard for your PC, so you can set the focus in a text box and it will be filled with the string form the scanner automatically after scanning. Then just read the .Text property of the text box to precess it in your code.

In the second case, you need to use MSComm control to read the string via serial interface. There is plenty of examples for the MSComm on the Net.

Kind Regards
Piotr Kowalski