Solved

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

Posted on 1998-04-19
5
228 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
Comment Utility
Are you trying to do a free-text search on a memo, or is it a single field ?
0
 

Author Comment

by:pedro1
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now