Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Access query in Visual Basic

I tried to get a response in the Visual Basic board, without luck. Perhaps my question was too basic, or not stated clearly enough. Anyway, I am a beginner at programming in VB and have a database project I am eager to complete.



I want to create a program that merely permits people to search a large database, without the ability to add, or make changes. I'd like to permit people to conduct a query by typing a keyword, or expression into a text box. Or perhaps enable them to type keywords into two text boxes, with the results returned being only records that include those words.



I would appreciate any direction in this matter. If you have an example I can study, or know of a book that provides detailed instruction in the creation of such a program, I would be very grateful.



-- Gerard


Comments

  • : I tried to get a response in the Visual Basic board, without luck. Perhaps my question was too basic, or not stated clearly enough. Anyway, I am a beginner at programming in VB and have a database project I am eager to complete.

    :

    : I want to create a program that merely permits people to search a large database, without the ability to add, or make changes. I'd like to permit people to conduct a query by typing a keyword, or expression into a text box. Or perhaps enable them to type keywords into two text boxes, with the results returned being only records that include those words.

    :

    : I would appreciate any direction in this matter. If you have an example I can study, or know of a book that provides detailed instruction in the creation of such a program, I would be very grateful.

    :

    : -- Gerard

    :

    I just created a project similar to yours, mine was a phonebook that you could search an Access database with any of the fields in your phonebook including a keyword. All you need to do is link an SQL statement to your text box or boxes. Such as: "SELECT * FROM PhoneBook WHERE KeyWord LIKE'" & strMessage & "'"

    strMessage is a string that you would assign to your text box. Then all you would have to do is use the % as a wild card. Or what I did is I concatinated my strmessage variable like this:

    strmessage = '%' & strmessage & '%'

    then use your SQL statement. It works slick.






  • SeftonSefton Posts: 43Member
    I am attempting the same type of query, however, I am having trouble following your instructions. I'm not sure I know how to link an SQL statement to a text box. Also, where exactly would you place your select statement? in the query itself?

    : : I tried to get a response in the Visual Basic board, without luck. Perhaps my question was too basic, or not stated clearly enough. Anyway, I am a beginner at programming in VB and have a database project I am eager to complete.
    : :
    : : I want to create a program that merely permits people to search a large database, without the ability to add, or make changes. I'd like to permit people to conduct a query by typing a keyword, or expression into a text box. Or perhaps enable them to type keywords into two text boxes, with the results returned being only records that include those words.
    : :
    : : I would appreciate any direction in this matter. If you have an example I can study, or know of a book that provides detailed instruction in the creation of such a program, I would be very grateful.
    : :
    : : -- Gerard
    : :
    : I just created a project similar to yours, mine was a phonebook that you could search an Access database with any of the fields in your phonebook including a keyword. All you need to do is link an SQL statement to your text box or boxes. Such as: "SELECT * FROM PhoneBook WHERE KeyWord LIKE'" & strMessage & "'"
    : strMessage is a string that you would assign to your text box. Then all you would have to do is use the % as a wild card. Or what I did is I concatinated my strmessage variable like this:
    : strmessage = '%' & strmessage & '%'
    : then use your SQL statement. It works slick.
    :
    :
    :
    :
    :

Sign In or Register to comment.