Solved

filter queery

Posted on 2004-03-22
1
196 Views
Last Modified: 2010-04-05
Is there a way to filter records using
checklistbox?
Example :
In checklistbox i have city names.
I would like my queery to search for people surnames only in the city
whose name i check in the checkbox.
For surname input I use edit1.
I am using ado (queery).
0
Comment
Question by:senad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
rafamvc earned 50 total points
ID: 10652731
query... ok
MAke parameters, and use:

ADOQuery1.Close;
ADOQuery1.Parameters.ParamByName('ParamName1').value := 'value you want';
ADOQuery1.Open;

to make parameters, you have to make them Like this on the sql field of ADOQuery:

SELECT * FROM TableYouWish WHERE FieldToFilter = :ParamName1

then Delphi automatic add the parameter with the name u gave, this case 'ParamName1' and you can use it like i told before.

Simple ;)
[]´s
Rafael Cardoso
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question