?
Solved

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

Posted on 1998-04-19
5
Medium Priority
?
253 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
[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
  • 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

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!

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month14 days, 6 hours left to enroll

771 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