Access query in Visual Basic - Programmers Heaven

Howdy, Stranger!

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

Categories

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.