Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another datasession anomaly
Message
From
15/03/2018 14:57:50
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Another datasession anomaly
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01658769
Message ID:
01658769
Views:
61
HI all,

Hank helped me out with one anomaly last year regarding datasessions and here is another:

- I am using a custom object to work up and print some data
- it is called from a form
- it creates a bunch of cursors and works up data using some of the data from the form's views and some cursors created on the fly

It has always worked but noticed this anomaly when stepping through the code while making some changes:

- the form has a datasessionID of 4
- when the object is instantiated, it has a datasessionid of 3 (which is the DS id of the *parent* form to this form)
- everytime I create a cursor in the object's code, watching SET("Datasession"), it temporarily "flips" to DS #4 and then back to DS #3

What gives? Hank explained last year that if I call prg code from a class that the datasession can change but if a class calls a class, it shares the DS.

Note: it is in a custom object because
a) it was cleaner to code with some methods called over and over and
b) it is only needed rarely on a form so why carry around all the code for the .1% of the time it is needed

The code works but would like to have it all run in the form'd datasession as it makes me nervous that it "flips" around.

Albert
Next
Reply
Map
View

Click here to load this message in the networking platform