Solved

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

Posted on 1998-04-19
5
242 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 50 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

Industry Leaders: 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

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 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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 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