Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I SEEK in a view?

Status
Not open for further replies.

phita

Programmer
Jun 8, 2001
82
0
0
KE
Hi,
I am creating an app using local views, to be upsized to remote views later. Now my problem is, how do I SEEK for a value in a view?
Do I have to INDEX the view every time I load the form? Is there a better and faster way to do a search without using LOCATE?

Thanks in advance.

Phita.
 
Phita,

The simple answer to your question is that you would have to create an index on the view. Since the index is not retained when the view is closed, you would have to re-create it each time you open or requery the view.

However, it is much better design for the view to only retrieve the one record that you want. In other words, rather than retrieving an entire table to the view and then searching the view for the required record, design the view so that it only retrieves that one record.

If that is not possible, the view should retrieve the minimum number of records possible, in which case you can use LOCATE to find the one you want.

The whole point of client-server design is to keep your views as small as possible.

Mike Mike Lewis
Edinburgh, Scotland
 
Hi Mike,

Thanks for coming to my rescue. I will do as you suggested.

Again, thanks.

Phita.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top