Solved

Search in paradox table

Posted on 2000-05-16
6
196 Views
Last Modified: 2012-05-05
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
6 Comments
 

Expert Comment

by:johnstoned
ID: 2814021
I think what you need to do is place a TTable component on your form, and set the table property to the name of your paradox table,

then, assuming the column name is 'Name'

.....

table1.Open;
table1.first;
if table1.locate('Name', 'book', [loPartialKey]) then
  showmessage('Found')
else
  ShowMessage('Not Found');

.....

the loPartialKey bit should mean you find any string containing 'book'.


Dave.
0
 
LVL 2

Expert Comment

by:IPCH
ID: 2850499
Sorry johnstoned,

but when you use loPartialKey you'll find <book> only if it's in the begining of the searched words. In Paradox there isnt't a statment for that kind of searching. In InterBase there is a CONTAINING staitment that makes all that you want, but unfortunatly Paradox don't supported it.
If you use Paradox you must create a function that collate every substring of field when you looping trought the table records. If you want some source I'll write some for you.

Regards
Ivan
0
 
LVL 1

Accepted Solution

by:
sageryd earned 15 total points
ID: 2856392
Why not use SQL?

like so:

Select Field1, Field2 from database.db
  where Field1 like "%book%"
order by Field1


--johan
0
Independent Software Vendors: 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!

 

Author Comment

by:sivatagiherceg
ID: 2857510
Comment accepted as answer
0
 
LVL 1

Expert Comment

by:sageryd
ID: 2858070
Thanx for the A! Simple solution huh! ;)
0
 

Author Comment

by:sivatagiherceg
ID: 2858654
Hi sageryd
You'r welcome any time
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

761 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