I have a barcode scanner - model LXE.
I need to scan a printed barcode & then display whats on this barcode in an access database.
How do i use VB to store the information i scan into my database?
Any advice would be great.
Printable View
I have a barcode scanner - model LXE.
I need to scan a printed barcode & then display whats on this barcode in an access database.
How do i use VB to store the information i scan into my database?
Any advice would be great.
Does the scanner have an interface? i.e. a comm port on it ?
not sure?? How do i tell. It has a screen which displays the barcode after you scan...However, currently when i scan the barcode it displays the wrong number?..(thats beside the point...i just need to be able to transfer the barcode info into a database...
Okay are there any little ports on the barcode scanner that look similar to your monitor connection ?
No, nothing. I cannot attach the scanner to a computer as i need to have flexiblilty in moving the scanner around a massive warehouse. I've been told that i need to scan / telnet to an IP address...so my vb program will sit on a computer & my scanner will hit that computer using a spefic Ip address and port...
I then need to store the scanned barcode into a table in my databse.
The barcode is already printed and waiting to be scanned, i just dont know how to communicate to my computer & store the scanned info in a database....
Sounds very complicated...! Where do i start?!
thank you.
So how are you proposing in getting the information from the scanner onto some sort of computer system?
If the scanner interfaces with a computer, you could use a laptop computer, and have a wireless network installed inside the warehouse...
We have access points / anteni set up on the roof of our warehouse! .......a radio network is already in place. My scanner is expected to bounce of this and be directed to an IP address (a computer on our network) and this is where the vb program will reside....
Winsock should work - using IP addresses to communicate....should i go down this line?..
assuming it's being sent to your ip then you could use sockets so you could investigate winsock, your server computer would have to listen all the time
Ok, i'll investigate how to use winsock.
Thanks for all your advice.
Hangon there's still something missing here.
If there's a wireless network in place, then there's no problem using winsock or anything like that for networking.
But what I want to know, is how is the scanner supposed to communicate with the network ?
TCP.... i assume. I specify an IP address & a port to connect to....that should work?
That much I get.
But...
Okay. You're holding a barcode scanner in your hands.
Does it have access to the network? Is it running windows?
Yes, my barcode will have access to the network.
No, it's not running windows.
Maybe its not possible? All very new to me...
I thought that i could scan the barcode - then the radio equipment we have installed would pick up the signal & transmit the barcode info via TCP to my specified IP address....
Will that work?
I've got a program which i used a couple of years back when i was initially going to do this..this project got put to the side & i never got around to doing it..
I think this program will maybe work...but i cant make sense of what this code is trying to do? or how it works. When i run it, nothing happens...i get no errors - it simply runs!
See attached..winsock sql example.
But you need something that can run a VB application that can somehow be given that barcode - i.e. the scanner can run a VB application, or, the scanner can interface with a computer...Quote:
Originally posted by gilly
Yes, my barcode will have access to the network.
Yes, i want my scanner to interface with a computer on my network. The computer will wait & listen for any connections - then once a scan is made - it will store it in my database.
My computer will run the vb application.
Any ideas how to get me off the ground?
The difficult issue is plugging the scanner into the computer - or somehow getting scanner information into your vb application.
What's it supposed to interface with?
Doesn't it come with some documentation? What's the brand and model?
LXE
xcvr model # 480824-3300
It's an old scanner - lost all documentation...
Are all barcode the same format? Do different barcode scanners read different barcode fonts?
Are you certain it has wireless feature? You mentioned telnet awhile ago... if so then I'm guessing it stores scan info in its internal memory. Then later on, you connect it via LAN card and a rollover cable and do a telnet session (just like configuring a router, switch) to download the stored data.
We have access points attached to the roof of the warehouse. These act as a router - they contain the IP info of the computer where i sent my scanned info to...
My software will sit on a computer on my network listening for an connections.
This is the idea...but i need help to get started coding?
okay this is what's going on after i read that entire thread what i get is that the baricode is connected to a router through wireless connection then it will send the data via IP to the correct IP and port of the computer which will be running the VB application then then application will save it all to database, correct?
and i dont think if it's sending info over the network then the computer wont actually need any drivers or info on the scanner the program would just grab the info it is sending to the router so all you really need to do is use winsock to grab the information from that IP and port of which the scanner is hooked up to and then put all the data into the VB application and save it to a Database via SQL
EXACTLY!. Do you know how i do this in winsock? Can you give me a kick start? I've been told that i should use telnet to sit & listen for a connection..
ok i was going through on how to do it and it's gonna be hard but yes winsock can do the trick but you really need to know what the IP is and Port the wireless barcode is connected to on the router and you'll have to forward anything coming from the barcode port to the port that the computer is on, get what i mean? so if you dont know what port the wireless connecter is set up to work on then your gonna have to get a portscanner and scan that IP to find the open port, whould only be one but may be more, we can talk more about it through email [email protected] or AIM(Aol Instant Messanger) krptodr
If your scanner is running PocketPC, I could really help you out.
You have to tell us what OS it is running.
He said it's old, so it's highly unlikely :(
hi gilly, hows you?
About this problem, i guess the scanner needs to be physically connected to a computer for it to actually scan, is it? or not?
then from this client computer you can send the data to your server using winsock or any other way.
But the main question, is the scanner connected to any computer or not?
No, its not connected to any computer - its a handheld scanner.
Im going to try & write a vb program that will sit and listen for a connection on a specific port.
Will winsock allow me to do this?
above somewhere you have mentioned that u have a wireless network with access points. but What I do not understand is, if your handheld scanner is old, like you say, how would the handheld transmit the data, what it scanned.
I'm assuming the access points will act like a router.....My scanner will have a programmed IP address & port set up within it....... When i scan a barcode it will find the computer with my vb program which will be sitting waiting/listening for a connection.
I then need to add barcode info to a database....whatever i scan i need to add to the database..
This is how i see it....
I've started my program - i have winsock set up, listening on port 1100 listening for a connection. It works. However I also need to be able to add the barcode number that i scan to my access database... this code below works , but doesnt add to a database....any ideas how to code this?
Cheers
VB Code:
Option Explicit Private nextSocket As Long Private strReceived() As String Private Sub Form_Load() With sock(0) .LocalPort = 1100 .Listen End With nextSocket = 1 Text1.Text = "sock(0) : Listening on port 1100" ReDim strReceived(0) End Sub Private Sub Form_Unload(Cancel As Integer) Dim i As Long For i = 0 To sock.Count If sock(i).State <> sckClosed Then sock(i).Close DoEvents End If Unload sock(i) Next End Sub Private Sub sock_Close(Index As Integer) Debug.Print "Connection closed on sock(" & Index & ")" Unload sock(Index) End Sub Private Sub sock_Connect(Index As Integer) Debug.Print "Connected on sock(" & Index & ")" End Sub Private Sub sock_ConnectionRequest(Index As Integer, ByVal requestID As Long) Dim i As Long Load sock(nextSocket) ReDim Preserve strReceived(nextSocket) With sock(nextSocket) .Close .Accept requestID Text1.Text = Text1.Text & vbCrLf & "sock(" & nextSocket & ") : Accepted connection" End With nextSocket = nextSocket + 1 End Sub Private Sub sock_DataArrival(Index As Integer, ByVal bytesTotal As Long) Dim strData As String sock(Index).GetData strData, vbString If InStr(strData, vbCrLf) = 0 Then strReceived(Index) = strReceived(Index) & strData Else Text1.Text = Text1.Text & vbCrLf & "sock(" & Index & ") : " & strReceived(Index) strReceived(Index) = "" End If End Sub
ok listen the barcode scanner is wireless so stop asking if it connectes to the computer, now Gilly if you say that the code is grabbing the scanned barcode from the port 1100 then it's gotta be working so yes that code is working but for it saving to the database you could make your own database and read and write it that way it's just mean alot of coding if you need help just ask me later
Thanks krpto!! Yes everyone - I'm making a wireless connection & i've tested it & it's works great!! My scanner doesnt need to be physically attached to my computer - it sends data via a wireless network.
Now that i have the communication established, i need to insert each barcode which i scan into a database.
How can i do this?
EG. if the barcode text reads something like this 123ABC78dd8888888777777
The first 2 digits represent a field in my table
The next 6 represent another field...etc etc...
I need to break up the string & insert it as indivdual fields into my table.
thanks for any help in advance.
well what you have to do is if you code in vb6 then to divide the first two digits is use the Left("string", how many numbers to get) which let's say if you wanan get the 12 of 12345678 you'd use
then have it do if then statements for where to put it if it falls under a certain category like if the 1 was sporting goods and then save it to that part of the database, im not familiar with barcodes so i can't tell ya what the different sections are, then if you wanna find the next 6 out you would use the Mid funtionVB Code:
strString= "12345678" label2.caption= left(strString, 2) ' the 2 is how many numbers to grab from the string
the mid fuction would be used like this,
now my memory is alittle vague on the mid function but what i think i haev set up is to start at the 3 and get the next 6 from the barcode, so if you need any other sections just use the mid function but for the first two deffinatlly use the left string function, that should work on how to split up the barcode into different sectionsVB Code:
strString= "12345678" label1.caption= Mid(strString, 3, 6) ' the 3 is the starting number to grab and the 6 is where to end
Thanks K
I've actually re-thought my project overnight & i feel it would be best if i could output the barcode information to a csv or text file.
i.e. when i scan each barcode i want to create a new text or csv file. i.e. store these text/csv files in a directory on my computer. C:\BarcodeFiles\. So each barcode which i scan will create a new file.
How do i do this? IS it possible....anyone?!
Use a dynamic array, each time you scan add a new array element to hold the info. Latre when your gonna create the text file, loop through the dynamic array.
For naming convention of the text file, to ensure it is unique, add the date mmddyy and time HhNnSs (military time) info to the filename
Barcodes - [Date] - [Time].txt
IMPO, yyyymmdd would be a better format so they will sort properly in the explorer window