Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select - Accessing older view if more than 1 instanc
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00005022
Message ID:
00005046
Vues:
25
>Can you shed a little light for me on the use of datasessions? Even though I have read about them, I'm still not sure how to use them, or even how to experiment with them. For example, how does one programmatically create a data session? I've already found that if you try to change to a datasession (via SET DATASESSION) that doesn't exist, you get an error message.


Private data sessions cannot be created programmatically. Every private data session is attached to a form. If you want to use private data sessions, you need to make sure that code that deals with the work areas in the private data sesion are methods for that form or for contained objects in that form. I have a library of routines (that used to be in a procedure file in 2.6) that are in a Visual Class Library(.vcx) class that do all my dbf routines, so I just plunk the library object onto the form and whala! the object can access all the work areas for this form.

Weird problems occur if you run procedure code (.prg) and then try to force the datasession by using the SET DATASESSION command. I have had things as weird as grids on the form being wiped out. So for rule of thumb: any code that needs to access .dbf data needs to reside in the general class structure of the form.

Hope this helps,
Peter
Peter Stephens
Visual Records, Inc.

Lead Programmer for the general purpose record keeping system Visual Records. Written primarily in VFP 6.0 with a little C++.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform