Solved

Search in paradox table

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

785 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