Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Datasession of a prg based form vs vcx
Message
De
08/12/2011 05:32:02
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Datasession of a prg based form vs vcx
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2003
Database:
MS SQL Server
Divers
Thread ID:
01530606
Message ID:
01530606
Vues:
256
I've built a simple form (one grid, exit button) to have an equivalent of a browse. It being that simple, I kept it in a little prg. And it worked alright.

Except when I tried to run it again in a different datasession. Despite being released, the form instantiated in the datasession where it was first instantiated... well, sort of. The grid's recordsource stayed the same as the first time, even though it was not found in the current datasession. The grid would be blank.

Then I rebuilt the form as a vcx class, and all of a sudden it just works as expected - the grid assumes the current alias as its recordsource.

I've had some borderline cases before, when I couldn't be sure of the datasession (or something else?) being as expected in prg-based classes instantiated and called across datasessions. This is the first time I have something verifiable. Did anyone encounter this?

update: just setting the grid's .recordsource=alias() sufficed - it now works from prg as well. This still leaves a question - why did the grid keep the recordsource from the first instance when prg based, and not when vcx based?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform