Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 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: 345371 # Views: 49 # Ratings: 0
Version: Visual FoxPro 8 Category: Grids
Date: Wednesday, May 23, 2012 12:48:32 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

The feature VFP's crew added for working on DBF tables through cursors are, and it's a giant step for mankind:

databases
the SQL languanage as prime tool for all or most data manipulation
local parameterized, updatable, buffered views
Requery()
TableUpdate()
TableRevert()

For working with other ODBC conncted RDDBMS databases:
the SQL language as prime or only tool for data manipulation
remote, parameterized, updatable, buffered views.
the same functions.
a visual design tool. CREATE [SQL] VIEW ...
See VFP's documentation:

Later in VFP's evolution the CursorAdapter class appeared. It's a cinch to use and master if someone else does all the work for you.

-Anders

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