Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datasessions - thisform.release
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00090329
Message ID:
00090338
Views:
28
>>>I have private datasessions for my forms and after the user is finished with a form they do a save (=tableupdate()) or cancel (=tablerevert()). the form is released and I would expect that to be the end of the datasession. The dataenvironment is set up to auto open and close the tables.
>>>
>>>However the datasession remains after the form is long gone. This interferes with the next form which might open up the same tables but with old values.
>>>
>>>Can anyone help me with the right strategy here?
>>
>>Sarah, the most common thing which can happen here - you have some outstanding object references in your form, so form doesn't get released and leaves the datasession open. It is not really gone. Check if you assigned any property to some object. You supposed to set such a property to .NULL. before you release your form.
>>
>>HTH,
>>Nick
>
>Hi Nick. Not sure about your answer. I have a "switchboard" type app and the main form has a method which calls the other forms. Part of it's code is responsible for making sure there are no other forms hanging around:
> m.lncount = _screen.formcount
> if m.lncount >= 2
> for i = 2 to m.lncount
> _screen.forms(i).release()
> endfor
> endif

>I don't think I understand the bit about assigning properties to objects, I do that all the time - to the form, to it's fields, commands etc.
>
>Sarah

This code is OK, but the form itself is not able to release itself because of the variables or properties may hold references like

myVar1 = thisform.grdGrid1
myVar2 = this
thisform.oGrid = thisform.pgfPageFrame.Page2.grdCustomers

(means you added the property to the form (or used one of the default properties of any form objects for that), and assigned one of the form objects to it (the same goes with variables).
So the property or memory variable may hold object reference, and because of that the object itself doesn't get released. Sometimes it is difficult to find references of that type.

Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform