Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Another datasession anomaly
Message
De
15/03/2018 14:57:50
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Another datasession anomaly
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Divers
Thread ID:
01658769
Message ID:
01658769
Vues:
60
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform