|
||||||
| Visual Basic Programming Discussion forum for Visual Basic, an event driven programming language and associated development environment from Microsoft for its COM programming model. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hi,
Sorry if this is the wrong place.. I'm a beginner at vb.net and Access. I'm using a barcode reader to scan in items, and then I want to search an access database and display the saved details on this item in the application. I'm wondering if anyone can put me in the right direction, What interface do I need the reader to be in: keyboard wedge/RS232? Do I need a API to act in between the two: Reader and vb.net Any help or advice would be great. |
| Sponsored Links |
|
|
|
|||||
|
All of the readers I have used simply scan and print the text wherever the cursor is. Your reader may be different but open notepad and scan something. Does the scanned text appear?
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
|
|||
|
Hi,
My scanner is working, it will scan the codes into notepad. I'm going to have the barcode numbers saved in access, so once i scan the items, vb will search for it in the database and display the details on the form. I hope this clears up what I'm trying to do.. Thanks, James |
|
|||||
|
Yes, that is clear. You don't need an API but you will need to code a timer and onChange event for your text box (or whatever the barcode will scan into). I suggest a timer because that is how I've done it in the past, there may be better methods. When the textbox changes (text is entered) start the timer. In three seconds execute your search function (I suggest three seconds because any sooner in my tests caused an incomplete fill from the scanner). What code do you have so far?
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
| Sponsored Links |
|
|
|
|||
|
Hi,
At the moment I'm having trouble even getting data to come back from databaase. I'm going to set the timer 2moro, and I'll let you know how it goes, I tried it with out timer, and like you said it didnt take in all of the barcode, only first number. This is the code I have at the moment: Code:
Private Sub txtBarcode_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtBarcode.TextChanged
'This searches the database for the required search fields
objScanDA.SelectCommand = New OleDb.OleDbCommand( _
"SELECT * FROM Product WHERE Barcode = '" + txtBarcode.Text + "' ", objConnection)
'Fill the DataSet
objScanDA.Fill(objDataSet, "Scan")
'Bind the text boxes
TextBox1.DataBindings.Add("Text", objDataSet, _
"Scan.Size")
TextBox2.DataBindings.Add("Text", objDataSet, _
"Scan.Price")
End Sub
Thanks. James Last edited by TcM; 02-01-2008 at 06:56 PM. Reason: Code Tags |
|
|||||
|
I created a barcode scanner for an LXE device running Windows Mobile 5.0 and this was the best (quickest) method I could come up with (using a timer). It works great still. Basically, just take everything you have in your textChanged function now and replace it with timer.start. Once your timer reaches 3 seconds execute what you have now.
If you need help let me know. I have C# code that does a similar procedure except it uses a network file created from Oracle instead of an Access DB.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
|
|||
|
Hi,
Thanks a million I got it working with the timer, But only problem is how would you go about scanning a number of items. Can I call the timer function from a button? Private Sub ScanNextItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ScanNextItem.Click Call Timer2_Tick() End Sub This is not working? I would be very grateful if you could send me on that c# code.. Thanks, James |
|
|||||
|
You should be enabling Timer2 instead of calling the Tick function. Once the timer count-down is complete it will execute the tick function. Can you post more of your code? Or attach the source here?b
It will be Monday before I can send the C# code. It is at work, also keep in mind it is for Windows Mobile 5.0 so it may look a little different. What version of Visual Basic are you using (2003/2005/2008)?
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Binding Access database to C# project | cowdog88 | C# Programming | 1 | 09-17-2007 04:12 PM |
| Retrieving Access Database | tigger | Visual Basic Programming | 0 | 07-06-2007 01:27 AM |
| Access database query using sql help !!! | ORACLE | Visual Basic Programming | 4 | 04-16-2007 02:12 PM |
| Database access | jimmyfrube | Visual Basic Programming | 1 | 04-03-2007 04:57 PM |
| Simple MySQL Database Search | Jaan | PHP Tutorials | 1 | 01-01-2007 11:15 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 97%