I am suppose to develope a application for a book shop . I have make use of Bar Code reader so can any one tell how to connect a bar code reader in my application WHICH DEVELOPED in Visual Basic 6.0 . Please treat this as most urgent
Private Sub mscomm2_OnComm()
Dim sBarScan as string
If iFlag = 1 Then Exit Sub
If flag = 1 Then 'Text boxes empty?
For i = 0 To 2
txt(i) = ""
Next i
flag = 0
End If
sBarScan = left(MSComm1.Input, 12)
rs.Open ("SELECT * from ItemInfo where Identifier = '" & sBarScan & "'" 'ItemInfo is table in my db
iDeptNum = rs(3) 'Get Dept# for scanned item
DeptAmt = rs(2) 'Get amt for scanned item
SubAmt = SubAmt + rs(2) 'This is subtotal
txt(0) = txt(0) & rs(1) & vbCrLf 'Add itemDescript to display
txt(1) = txt(1) & FormatNumber(DeptAmt, 2) & vbCrLf 'Add amount of item to display
rs.Close
ScratchPad 'go add the scanned amount into the department
arna, as far as I'm concern, barcode scanner acts just like a keyboard. It reads barcode, send it to PC and display it on a human readable character (text). So I guess you don't have to worry about how to "read" input from a barcode scanner.
you can do a simple test if you're not sure. Go to MS-DOS prompt, scan a barcode and see what displayed on screen. It should be a common text like we know.
Hey Arna, I have developed a number of apps using barcode scanners, mostly the type plugged into the keyboard port. They send data through as if it were being typed. Depending upon which scanner you are using, and the barcode types (I know ISBN numbers often have additional 2-of-5 codes tagged on to show the price etc) I have loads of short subs for barcode checksum validation etc, if anyone wants it I can send them through.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.