[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Search in paradox table

Posted on 2000-05-16
6
Medium Priority
?
200 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 60 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

650 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