Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table in another DataSession
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00405836
Message ID:
00407093
Views:
22
>I call a form (b) from another form (a).
>Each Forms use private datasession.
>
>I will know how can i do to populate a grid in form (b) with a table that is i datasession of form (a). How i refere to the datasession of the form (a).
>
>Thanks,

The best way to do this (IMO) is to have a method on form A that fills an array with the data you need. You could pass an object to it from form B with an array property. Form A's method could perform a SQL Select into the array property. Once you are back in the form B method that initially makes the call, you can create a cursor and append from the array property in the object.

I would recommend doing this in form B's Load event so the result cursor can be built before the grid is instantiated.

You could also go the heavy weight approach and use ADO. Call a method in form A from the Load event in form B. Form A builds a cursor, converts that to an ADO recordset using the VFPCOM utility and passes that back to the form B method. You can then use the same VFPCOM utility to convert it back into a cursor and use it for your grid.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform