To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
Part 10 of the Visual Basic .NET 2010 Express Tutorial Complete!
How to Use the Visual Studio Code Analysis Tool FxCop
Article :: Interview with Andrei Alexandrescu (Part 3 of 3)
Introducing Visual Studio LightSwitch
Visual Studio LightSwitch Beta 1 is Available



Go Back   VBForums > Visual Basic > Visual Basic .NET

Reply Post New Thread
 
Thread Tools Display Modes
Old Jun 22nd, 2007, 01:00 PM   #1
DagMX
New Member
 
Join Date: Jun 07
Posts: 3
DagMX is an unknown quantity at this point (<10)
Newbie Help: Query Builder

I'm in a hurry so I'm sorry if I overlooked something obvious.
I haven't coded in Visual Basic for well over 5 years so I'm very rusty and I need to create a database frontend that allows a user to see a table in a .mdb and also search through the columns.

So I do the following:
1)New Project and add the mdb and table as a data source.
2)Drag the table into the form and use the query builder to create a search for the Title Column by adding (WHERE Title=?) or (WHERE Title like ?)

However when I use the search query, it'll only show results that match exactly whats in the search box. I need it to display similiar results as well.

eg: If I type in Harry Potter, I need it to show three different Harry Potter Titles. If I type in Tolkien I need it to show results for JRR Tolkien as well.

How do I set this up? It's probably something obvious but like I said I was in a hurry so I possibly overlooked it.
DagMX is offline   Reply With Quote
Old Jun 22nd, 2007, 01:15 PM   #2
nmadd
Frenzied Member
 
nmadd's Avatar
 
Join Date: Jun 07
Location: Colorado, U.S.A.
Posts: 1,676
nmadd is a jewel in the rough (200+)nmadd is a jewel in the rough (200+)nmadd is a jewel in the rough (200+)
Re: Newbie Help: Query Builder

Hi Dag,

You can use wildcard characters.

For example:
%Potter% will match "Potter" anywhere in the title.

Read a lot more about them here:
http://office.microsoft.com/en-us/ac...881851033.aspx

Good luck
nmadd is offline   Reply With Quote
Old Jun 22nd, 2007, 01:38 PM   #3
DagMX
New Member
 
Join Date: Jun 07
Posts: 3
DagMX is an unknown quantity at this point (<10)
Re: Newbie Help: Query Builder

How would i go about making sure that the % sign is automatically added before and after the text to search for?
DagMX is offline   Reply With Quote
Old Jun 22nd, 2007, 01:45 PM   #4
nmadd
Frenzied Member
 
nmadd's Avatar
 
Join Date: Jun 07
Location: Colorado, U.S.A.
Posts: 1,676
nmadd is a jewel in the rough (200+)nmadd is a jewel in the rough (200+)nmadd is a jewel in the rough (200+)
Re: Newbie Help: Query Builder

Something like this:

(WHERE Title Like '%' + ? + '%')
nmadd is offline   Reply With Quote
Old Jun 22nd, 2007, 01:51 PM   #5
DagMX
New Member
 
Join Date: Jun 07
Posts: 3
DagMX is an unknown quantity at this point (<10)
Re: Newbie Help: Query Builder

Oh man, thank you so so much! That worked perfectly.
Damn, i feel like an idiot for not trying that...but anyway, thanks. My project is finally done.
DagMX is offline   Reply With Quote
Old Jun 22nd, 2007, 01:55 PM   #6
nmadd
Frenzied Member
 
nmadd's Avatar
 
Join Date: Jun 07
Location: Colorado, U.S.A.
Posts: 1,676
nmadd is a jewel in the rough (200+)nmadd is a jewel in the rough (200+)nmadd is a jewel in the rough (200+)
Re: Newbie Help: Query Builder

Glad to help.
nmadd is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic .NET


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:26 AM.





Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.