Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New DS in a program - have problems - Urgent!
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00458554
Message ID:
00458977
Views:
19
When functionality built into some object in framework and does not require extra programming for users of that object - it is even MUCH more better than development using some weird session objects used by hacking ways (natural purpose of session object - to use together with forms).
>

I disagree with this statement entirely. I don't think session objects should be used with forms.

Session objects create datasessions. That and their small number of exposed PEMs make them perfect candidates for business objects/COM servers.

Using them with forms presents two scenarios:
1. Use AddObject/NewObject to add it to the containership of the form. If you do this, you kill one aspect of the session object. It no longer has its own datasession. It participates in the form's.
2. Use CreateObject and then assign it to a form-level property. This presents a problem if you call methods within the session object. VFP automatically changes the datasession when you run code within an object. Since the form will still have focus, this could wreak havok with any bound controls because the datasession will have changed and any table they are bound to will probably not exist in the new datasession. Most controls but especially your grids, will be useless.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform