Solved

Search in paradox table

Posted on 2000-05-16
1
208 Views
Last Modified: 2010-04-04
I need to make a program which search
a string in a paradox table. So, what I actually need is a source code example for the search.
for example the data what i have is
book 1
book 2
Delphi book
Access book  
The search what i need as follow, if i search for word "book" it has to show me all the records which not only starts with the word "book" it has to show me also "delphi book" and "access book" too
thank you in advance

0
Comment
Question by:sivatagiherceg
1 Comment
 
LVL 2

Accepted Solution

by:
aubs earned 15 total points
ID: 2814058
You can use a TQuery component to return a recordset of all the records containing the search word.


Drop an edit box a memo, a button
and a  TQuery component on a form put this statement in the SQL property

SELECT * FROM Books        (or whatever the db name is)
WHERE BookTitle LIKE :BkTitle  (assuming BookTitle is the fieldname!))

Set the DatabaseName property to the directory of the database (or alias if one is set up)

in the onclick event for the button add

Query1.ParamByName('BkTitle').AsString:= '%'+edit1.text+'%';
Query1.Prepare;
Query1.Open;
memo1.clear;
While not Query1.EOF do
   memo1.lines.add(query1.FieldByName('BookTitle').AsString);
Query1.Close;

Run the prog.
type the search word into the edit box and click the button.

Regards

Aubs
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
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…

856 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