Solved

filter queery

Posted on 2004-03-22
1
195 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
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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
Dynamically Created Query 3 69
Delphi...Split view - idea? 1 113
update joined tables 2 61
Add New Database Table in database file using delphi 3 27
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

679 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