Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sharing Tables across Forms
Message
De
09/08/2006 19:39:16
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
09/08/2006 18:04:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01144322
Message ID:
01144348
Vues:
16
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform