Solved

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

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Correct Component for Shopping Cart. 2 112
How to debug For loops? 3 56
How to Get Images From Server to Client using App Tethering 1 26
DBCtrlGrid, Delphi, Scroll 8 38
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

838 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