Closed Thread
Results 1 to 9 of 9

Thread: How to get barcode reader to search Access Database

  1. #1
    JamesN is offline Newbie
    Join Date
    Jan 2008
    Posts
    4
    Rep Power
    0

    Unhappy How to get barcode reader to search Access Database

    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.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jordan Guest
    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?

  4. #3
    Xantara's Avatar
    Xantara is offline Newbie
    Join Date
    Jan 2008
    Location
    Pennsylvania
    Posts
    22
    Rep Power
    0
    i'm confused...your title states "search access"....so..

    What exactly are you trying to do? Are you scanning something with a barcode and then putting it in an access database and you want to know how to go from the scan to the database?

    If this is the case, i may be able to help you
    Xantara...

  5. #4
    JamesN is offline Newbie
    Join Date
    Jan 2008
    Posts
    4
    Rep Power
    0
    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

  6. #5
    Jordan Guest
    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?

  7. #6
    JamesN is offline Newbie
    Join Date
    Jan 2008
    Posts
    4
    Rep Power
    0
    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
    It runs, but nothing happens. I need to set the timer, and hopefully that will make a difference.

    Thanks.
    James
    Last edited by TcM; 02-01-2008 at 03:56 PM. Reason: Code Tags

  8. #7
    Jordan Guest
    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.

  9. #8
    JamesN is offline Newbie
    Join Date
    Jan 2008
    Posts
    4
    Rep Power
    0
    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

  10. #9
    Jordan Guest
    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)?

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Access toi Database
    By djscottyis in forum PHP Development
    Replies: 0
    Last Post: 05-10-2011, 02:01 AM
  2. barcode for access
    By techker in forum General Programming
    Replies: 11
    Last Post: 02-20-2009, 01:53 PM
  3. search in access Database - VB 2005
    By kadosh1000 in forum Visual Basic Programming
    Replies: 1
    Last Post: 01-24-2009, 11:55 AM
  4. uploading database records in the access database in vb.net
    By Diana86 in forum Visual Basic Programming
    Replies: 0
    Last Post: 11-20-2008, 10:50 PM
  5. Need to code a search form in Access db
    By Xantara in forum Visual Basic Programming
    Replies: 1
    Last Post: 04-03-2008, 02:27 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts