1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I'm using visual basic 2008 express edition and I'm not sure how to attach my query

Discussion in 'Visual Basic ( VB )' started by babe20042004, Dec 3, 2010.

  1. babe20042004

    babe20042004 New Member

    Joined:
    Dec 3, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I'm using visual basic 2008 express edition and I'm not sure how to attach my query in order for it to run?

    I've been using trying to use visual basic to create a form which retrieves data from a Microsoft access database and filters the data to find the record starting with the letter retrieved from the user. When it is run without the query the data grid shows all the records. However when my original query is put in the application changes it and the value shown is null in all fields.

    This is what i had before
    SELECT Allergies, Breakfast, Lunch, Supper, FirstName, LastName, MealDate, StudentId
    FROM [Student Checklist]
    WHERE (LastName LIKE @LastName + '%')

    This is what was returned
    SELECT Allergies, Breakfast, Lunch, Supper, FirstName, LastName, MealDate, StudentId
    FROM [Student Checklist]
    WHERE (LastName LIKE '@LastName' + '%')
     

Share This Page