sivatagiherceg
asked on
Search in paradox table
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
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
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Comment accepted as answer
Thanx for the A! Simple solution huh! ;)
ASKER
Hi sageryd
You'r welcome any time
You'r welcome any time
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.