Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Forms and Datasessions...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00146720
Message ID:
00167789
Vues:
32
< snip >

>>Where is your code for field validations? If its in a procedure file or in code that calls the form, you'll have problems accessing the private datasession for a form. VFP insists on changing the datasession for exteranl code to a form back to the default session. Its not recommended practice, but you COULD change the datasession in your external code (SET DATASESSION TO _SCREEN.ActiveForm.DataSessionID). If the validation code is part of the object on the form, you don't have the problem of the datasession being changed.
>
>
>In regard to your comment , We have a prg in our project that opens tables in a datasession and have noticed this problem. What do you mean by 'external'? Does this common code need to be a method in the form, or would it work properly as a method in the app?
>
>Thanks in advance for any assistance you might provide.
>Nancy

By 'external' I mean code that is not a method of the form. IE code in a procedure file or code in a .PRG that calls the form. You can still reference the datasession by the above _SCREEN.ActiveForm.DataSessionID mentioned above, or you could pass the form reference to the code and use oForm.DataSessionID:

myExternalFunction(thisform)

myExternalFunction.PRG
LPARAMETER oForm
SET DATASESSION TO oForm.DataSessionID
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform