Solved

Search in paradox table

Posted on 2000-05-16
1
205 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now