Hey, I need some help with this. Here's what I'm trying to do. I have a table in an access database called "Poolpass". This table has the following columns: "Lastname", "FirstName", etc.
This what I want to do:
User selects what they want to search by in a combobox on my form (ie. Lastname, Pass #) Then in a textbox they enter the corresponding information (ie. If they chose to search by Lastname then they would type "Johnson" In the textbox.) When the user clicks the search button, I want to search the column of my table that corresponds to the "Search by" category they selected. When a match is found I want to add all the information from that record to a row in my Listview. Basically, this is a project for me to practice database stuff on. I'm doing this for fun and to help us out at work. What would be the best method to do this by? This is a really basic program so I don't need anything fancy. Here's a look at what the interface looks like below.
Ok, I'm a little confused now. Do I not need to connect to the database when my application launches? Also, is SQL the easiest way? Will the search find multiple matches if more then one person has a lastname of say "Johnson"? The code previously posted makes a little sense, but I haven't worked with DB in a long time. Basically, once I have the recordset stored, how can I load each match to the listview? I know how to add items to a listview, but not from a recordset? Can anyone give me any clearer of any example? Any help is extremely appreciated. Thanks
Originally posted by hipopony66 That code you posted makes perfect sense to me except where you say to create the recordset using the SQL string. How do I do that?