Database & SQL

Moderators: None (Apply to moderate this forum)
Number of threads: 1194
Number of posts: 2247

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Edit Report
Access query in Visual Basic Posted by GBC on 4 Jul 2000 at 4:27 PM
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
-- Gerard


Edit Report
Re: Access query in Visual Basic Posted by Rob on 5 Sept 2000 at 8:42 AM
: 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.<br>
: <br>
: 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.<br>
: <br>
: 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.<br>
: <br>
: -- Gerard<br>
: <br>
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 & "'"<br>
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:<br>
strmessage = '%' & strmessage & '%'<br>
then use your SQL statement. It works slick.<br>
<br>



Report
Re: Access query in Visual Basic Posted by Sefton on 13 May 2002 at 7:51 AM
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.
:
:
:
:
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.