Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sharing Tables across Forms
Message
From
09/08/2006 19:39:16
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
09/08/2006 18:04:14
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01144322
Message ID:
01144348
Views:
11
>I have a form that can have multiple instances created by the user. Each instance of the form has its own private datasession. However, I would like to be able to share a common table (cursor) across all the various instances of the form.
>
>My first thought is to define a custom session class and attach to the _screen with a cursor created in the Init method. This cursor would then be shared amoung the forms. But how to access and pass data from/to the form's private session tables to this 'shared' cursor? When I switch datasessions, the other datasession's tables no longer are visible. Is there a way to accomplish this with a cursor (sharing across forms with private datasessions)? The forms are required to have private datasessions to keep their data separate from each other, so how to combine the shared datasession?

I use a technique I call conditionally private data sessions. If a form (lineitems) is summoned from a parent form (invoice) the child form adopts the datasession of the parent form, conditionally opens and leaves open the line items cursor and saving is handled by the parent's datasession.

Lookup forms are not children in that sense. They save data to their tables.

Private datasession forms can be taken too far, IMO.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform