Solved

Search in paradox table

Posted on 2000-05-16
1
211 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
[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
 
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

688 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