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

Cursor in Data Environment

SitesMasstec

Programmer
Joined
Sep 26, 2010
Messages
578
Location
Brasil
Hello colleagues!

A have a Form which has in its Data Environment the table TEMPREC2.DBF (it is a temporary table with selected records from another table).

Is it possible to have a Cursor in the Data Environment of the Form, instead of that table?

Cursor has a random name, so I could not define it in the Data Environment of the Form. Is there another way to do it?

Thank you.
 
you can create and populate your cursor in a new method defined in your form.
this new method can be called from Form.init method
 
The data environment can contain:
1. Tables
2. Views
3. Cursoradapters

So the direct answer is no. You can create a view that queries the data, you can create a cursoradapter that queries the data, but I doubt you'd want that, as it has much overhead and not just the query. Instead, just write a query INTO CURSOR in code, like in the Load event of a form or in the BeforeOpenTables event of the data environment.

I would recommend the Load event of the form, as code in there is easier to discover, later, to see code of the Data Environment you always first need to open the Data Environment to get to its code.
 
Last edited:

Part and Inventory Search

Sponsor

Back
Top