[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Locating a second occurance of text in a paradox 7 db file?

Posted on 1998-04-19
5
Medium Priority
?
264 Views
Last Modified: 2010-08-05
How can I locate a second occurance of lets say for example 'Mike' in a paradox 7 db table after I have found the first occurance of 'Mike'.

Thanks.
0
Comment
Question by:pedro1
  • 3
  • 2
5 Comments
 
LVL 3

Expert Comment

by:KE
ID: 1335194
Are you trying to do a free-text search on a memo, or is it a single field ?
0
 

Author Comment

by:pedro1
ID: 1335195
Ill try to make it clearer.
I can use locate on a single field to search for 'Mike'.
The record that has been found is correct but i now want to search further on in the field for the next time that 'Mike' appears within this field. In other words I want a next button to search for the second and maybe more occurances of 'Mike' in the same field. Locate just starts from the beginning again and finds only the first occurance of 'Mike'
Cheers Mike.
0
 
LVL 3

Accepted Solution

by:
KE earned 150 total points
ID: 1335196
Well, you will need to index (or order) on the field your'e searching on, and then use next. I assume your'e going to use it as an search routine, another way would be to make separate query which you invoke by select xxx from table where field like "Mike" (it also have some wildchars) - then use the result of this query which should be an unique field to control your main table:
In this way, you will have both the number of matches, and an "easy" way to switch between occurances.
F.ex when you have made a search (activated the query) you set the DataSource/IndexFields property (you now what i mean) of the table to the Query that should control the table. When you reset the search simply "disconnect" the table from the query.
You will need an unique field to do this, but it takes very few lines of code to implement and it's quite expandable since you can search on multiple fields with the query.

0
 

Author Comment

by:pedro1
ID: 1335197
What do you mean 'use next'. Is there a Locatenext command and if so how do I get it to work. I have all the fields indexed.
Is there any chance you can show me some code on how to locate the next occurance of 'Mike' please. I didn't make it too clear that this is the first programming lanuage that I have really tried to learn properly.
michael.ross@cableinet.co.uk
Cheers Mike Ross
0
 
LVL 3

Expert Comment

by:KE
ID: 1335198
Let's say you have a normal table component with table XXX and field YYY that you want to search on. If your table is UNIQUE indexed you can make an additional query with the following SQL statement:
SELECT UNIQUEFIELDNAME, YYY FROM XXX WHERE YYY LIKE "Mike"
Thereby use the results of the query to browse the normal table component - in this case you set the table mastersource to the DataSource of the Query (and link the unique fields), and the index of the table should equal the UNIQUEFIELDNAME in the query.
Hereby you can browse the searched values in the master table by issuing next and prev. statements to the query. When you are finished with the search, disconnect the mastersource of the table.
Hope it was a little clearer this time, sorry !!!

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

873 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