Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data buffering without a data environment
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00409637
Message ID:
00410402
Vues:
25
I take it you then have your forms set up to participate in the default datasession (Datasession - 1). If you do, then the forms should open and use the tables/views available in datasession #1. If not, then when you open the tables/views in the private datasession of the new form, you have to reset the buffering for each one.

On your related note, the only way for forms to participate in the same datasession as other forms is for the Datasession property to be set to 1. This tells VFP not to create a new datasession for the form and use the datasession that is currently active when the form is launched. If you call Form B from a control on Form A and the Datasession property is set correctly, then nothing else needs to be done. If, however, if you call Form B from the menu and you want that to participate in the datasession of Form A, you have to make sure the Datasession proeprty is set correctly and you have add code in Form B's Load event to change the datasession to the appropriate datasession.

Ex.
Load event of Form B
if vartype(_Screen.ActiveForm)= "O" ;
   and pemstatus(_Screen.ActiveForm,"BaseClass",5) ;
   and upper(_Screen.ActiveForm.BaseClass) = "FORM" then
   set datasession to _Screen.ActiveForm.DatasessionID
else
   * no ActiveForm or possibly VFP anonomaly of ActiveX controls reporting as ActiveForm
endif
HTH.

>Larry, my sequence of ebets is as follows:
>
>I run a .PRG : MYSTART.prg
>1. MyStart.prg opens any DBc' uses ALL files,and sets buffering e.g.
> Open data MYDATA
> Use Myfile in 0
> ..set buffering etc
>2. Do Menu Mymenu
>3. Mymenu then calls the from as in : Do Myform
>
>
>On a related issue, if I have Data Session set to private and I call Form B from Form A, Form B does not seem to respect Form A's opened files. Is there a way of getting Form B and Form A to look at the same files and sessions?
>
>Regards,
>Gerard
*snip*
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform