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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to index a remote view?

Status
Not open for further replies.

CFPR

MIS
May 9, 2003
58
PR
Remote views are all ready sorted by the 'order by' clause in the designer. They may slo be programatically created with create view...

Now, is there a trick out there to re-sort a remote view by any give field, without affecting the original view?

My guess is that it can't be done and can only be achieved with an updateable ADO recordset than you can 'requery' or rebuild the SQL statement on the fly.

Any comments?

MW
 
Hi

Have you tried creating a tag in the name of the field as if you are indexing a table ?

You can create tags and set order to that. :)



ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
This is one of the be beautiful thing about VFP. You have its powerful data engine even if you work with remote views.
You simply can :
INDEX ON {field} TAG {tagname}
SET ORDER TO {tagname}

You can use ATAGINFO() to check if the remote view has required index tag and index if it doesn't have it.

and REQUERY() works too.

 
This is one of the the beautiful thing about VFP. You have its powerful data engine even if you work with remote views.
You simply can :
INDEX ON {field} TAG {tagname}
SET ORDER TO {tagname}

You can use ATAGINFO() to check if the remote view has required index tag and index if it doesn't have it.

and REQUERY() works too.

 
MW,

Yes, you can index a remote view in exactly the same way as a table.

However, there is an important difference. When you close the view, the index will be deleted. When you open it again, you will have to re-create the index.

If you think about it, that is correct. As VFP has no way of knowing what is happening to the data while the view is closed, the index cannot be maintained if the view is not open.

Having said that, why do you want to index a remote view? Good client/server design dictates that the record set in a remote view should be as small as possisble. Typically, a view should be small enough to search without the benefit of an index.

Mike


Mike Lewis
Edinburgh, Scotland
 
Hi folks. Sorry I didn't response but I was out for the weekend. Finally a non-working weekend!

Anyway, I tried the posting and it worked. I was getting an error because of table buffering on a remote view but as soon as I did a CURSORSETPROP("Buffering",3,"my_table") it worked perfect.

Mike, to follow up to your question, the remote vie wis being used on a grid with anywhere from 1 to 50 records. The idea is that if the click the header column it will sort by that field only.

Thanks to all!

MW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top