Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datasession of a prg based form vs vcx
Message
From
08/12/2011 05:32:02
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Datasession of a prg based form vs vcx
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2003
Database:
MS SQL Server
Miscellaneous
Thread ID:
01530606
Message ID:
01530606
Views:
257
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.
Next
Reply
Map
View

Click here to load this message in the networking platform