Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: Roy Slough
  Where is Roy Slough?
 Potters Bar
 United Kingdom
 Roy Slough
 Tags
Subject: RE: Method of data retrieval for grid
Thread ID: 345357 Message ID: 345379 # Views: 58 # Ratings: 0
Version: Visual FoxPro 8 Category: Grids
Date: Wednesday, May 23, 2012 4:16:30 AM         
   


> Hi,
>
> I have done some work with grids on forms using the data environment for one/two tables.
>
> Now I have to create the "Main" grid search form which will include fields from many files including several links to an application codes file where all my code descriptions are.
> i.e. a status code in the order file links to a status description in the appcodes
> a method of receipt code in the orders file links to a description in the appcodes file etc.etc
>
> So far pretty normal stuff.
>
> Now I have read that it would be better to base my grid on a Cursor of data instead of the actual tables.
>
> When I add tables to the Data Environment of the form it creates cursors with aliases for me.
> Are these the cursors I should use and then when I want to filter the records apply filters to these
>
> OR
>
> DO I build an SQL statement in the code and then re-query when the user selects different selection criteria.
> (If so where do I put this SQL statement as when I run the form it either gives an error OR displays data from the most recent table opened)
>
> SO in summary, I could write a long SQL statement bringing in all the fields and making the links necessary, but how do I link the grid to it OR what method should I use.
>
> Thanks


Like what Mike says, read Andy Kramek's Safe Select approach which involves manipulating two cursors or do what Cetin shows you which is a single cursor approach.

Also I advice you to read these as well:

Grid Reconstruction - http://sandstorm36.blogspot.com.au/2011/12/grid-reconstruction-why-how-and-when-it.html
Nofilter clause - http://sandstorm36.blogspot.com/2011/09/nofilter-clause-on-sql-select-when-to.html


http://sandstorm36.blogspot.com
http://weblogs.foxite.com/sandstorm36

ENTIRE THREAD

Method of data retrieval for grid Posted by Roy Slough @ 5/22/2012 9:16:05 PM
RE: Method of data retrieval for grid Posted by Mike Yearwood @ 5/22/2012 9:36:42 PM
RE: Method of data retrieval for grid Posted by Anders Altberg @ 5/23/2012 12:48:32 AM
RE: Method of data retrieval for grid Posted by Cetin Basoz @ 5/23/2012 2:19:09 AM
RE: Method of data retrieval for grid Posted by Jun Tangunan @ 5/23/2012 4:16:30 AM
RE: Method of data retrieval for grid Posted by Cetin Basoz @ 5/23/2012 11:31:46 AM
RE: Method of data retrieval for grid Posted by Jun Tangunan @ 5/24/2012 12:06:38 AM
RE: Method of data retrieval for grid Posted by Roy Slough @ 5/23/2012 12:32:11 PM