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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I use Barcode in my VB Application ?!!?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I need your help for how to got the corresponding no. for the Barcode when the Barcode scanner scan the product's barcode. I need the following:
When the scanner scan the product's barcode I want to get that corresponding no. and store it in the Database.

Please give me the appropriate technique.

Thank you everybody ...
 
The barcoding side of that is very simple.

With the so-called 'keyboard wedge' type of scanner, the scanner is plugged into the cpu's keyboard socket and the keyboard plugs into the scanner. So when the scanner sends a code it arrives at the pc just like it had been typed in. For instance if you have a textbox on a form and it's got focus, the scanned string will appear in the textbox.

How you get that into the data base is another question which has nothing to do with barcoding as such, and depends on what your database is. Jim Brown,
Johannesburg,
South Africa.
My time is GMT+2
 
re getting the barcode into the database.

i am a foxpro programmer, so what i say works there, may help you with your VB situation.

with an input form on the screen, the cursor is located in a required input field. behind the scenes, this field will hold the ASCII equivalent of the visual barcode (when scanned) in a memory variable.

thus, when the scanner scans the barcode on the product, the memory variable holds the ASCII equivalent of the visual barcode, you of course then write a bit more code to get the value of that memory variable back into your database.

hope this helps

Pete Bloomfield
Down Under
 
Try this
In the "Change" event of the text box that you are scaning the barcode into, have your ADO or DAO code like so:

ADO DSN-less connection to Access database

Dim Conn2 As ADODB.Connection
Dim Rs1 As ADODB.Recordset
Dim SQLCode As String
Set Conn2 = New ADODB.Connection
Set Rs1 = New ADODB.Recordset
Conn2.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = yourdatasbe.mdb"
SQLCode = "INSERT INTO [yourtable] ( firstField, secondField) SELECT " & me!BarcodeBox & " AS Expr1, otherdata AS Expr2;"
Rs1.Open SQLCode, Conn2, adOpenStatic, adLockOptimistic

' close it this way
Set rs1 = nothing
Set Conn2 = nothing


DougP, MCP
 
Also you are going to have to turn on a "reference" in the "Tools" / "References" menu. DougP, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top