none
Finding an entry in an access database

    Question

  • Hi everyone,

    I want to find an entry in an access database.

    I've employees database it have 4 columns (Name , Age , Nationality , E-mail address)

    I've in it 100 entries.

    And my questions are:

    1-I want to find all employees those names start with "Tim".

    2-I want to find an employee that his name is "Charles Sterling".

    3-I want to find all employees those their ages are "30 years old".

    *I want to show all results in a message box.


    Thank you in advance.


    Try my new web explorer        &        Try my new program
    Genius Web Explorer                         Genius Desktop Clock
                        
    Go to the Home Page                         Go to the Home Page
    Saturday, August 14, 2010 10:41 PM

Answers

  • start here:

    http://www.google.com/search?q=VB.NET+OleDb+Select+Access&rlz=1I7DKUS_en&ie=UTF-8&oe=UTF-8&sourceid=ie7

    these are links from a Google search as stated above. The first couple show you pretty much everything you need to connect to the database file.

    first work on getting the connection working right and displaying all the info in your app, such as in a datagridview. So create a test app with nothing more than a datagridview to display the db data, and start going through the sites in the link above to connect to the database.

    If you still can't connect to the databse or display the data, post your code with the specific problem.

    Once you get that working correctly, you can work on filtering the data with different SELECT statements.

     

    Sunday, August 15, 2010 3:19 PM

All replies

  • if you google something like VB.NET OleDb Select Access you will get lots of examples of SELECT statements

    however, they would look like this:

    to find Charles Sterling:

    SELECT *
    FROM [tablename]
    WHERE Name = 'Charles Sterling'
    

    to find all those whose Age = 30:

    SELECT *
    FROM [tablename]
    WHERE Age = 30
    

    to find all those whose Name starts with Tim:

    SELECT *
    FROM [tablename]
    WHERE Name LIKE 'Tim%'
    

     

     

    Sunday, August 15, 2010 12:19 AM
  • Hi jwavila,

    Thank you for you response .

    But i didn't understand this code because that's my first time that i try to use SQL statements so that i want some explaining that covers :

    1-Where should I write these codes.

    2-How to run this code if I want to use it.

    And thank you in advance.


    Try my new web explorer        &        Try my new program
    Genius Web Explorer                         Genius Desktop Clock
                        
    Go to the Home Page                         Go to the Home Page
    Sunday, August 15, 2010 11:50 AM
  • start here:

    http://www.google.com/search?q=VB.NET+OleDb+Select+Access&rlz=1I7DKUS_en&ie=UTF-8&oe=UTF-8&sourceid=ie7

    these are links from a Google search as stated above. The first couple show you pretty much everything you need to connect to the database file.

    first work on getting the connection working right and displaying all the info in your app, such as in a datagridview. So create a test app with nothing more than a datagridview to display the db data, and start going through the sites in the link above to connect to the database.

    If you still can't connect to the databse or display the data, post your code with the specific problem.

    Once you get that working correctly, you can work on filtering the data with different SELECT statements.

     

    Sunday, August 15, 2010 3:19 PM