Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Forms and Datasessions...
Message
From
15/10/1998 17:07:33
 
 
To
15/10/1998 16:52:03
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00146720
Message ID:
00147248
Views:
45
>>
>>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.
>
>The form(s) are being called either by a menu hit or a prev. form...the actual validation code is in one of the form's UDF methods ..which is called from the "valid" of each field to "validate" the fields contents....
>The datasession is already changed/changes when the form is activated...I assume because the "READ EVENTS" was executed at the "DEFAULT" datasession level?

If the code is part of the form, you shouldn't have problems. Validation code should be part of the object it's validating, though.

Where the READ EVENTS is has no bearing on the datasession. That's controlled by the form. (For some real amusement, put a SET('DATASESSION') as a watch point in the debugger, and move your mouse around over your form and then over the main VFP background. You'll see the datasession change as the mouse moves.)
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform