Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Private DataSession Won't Close Out?!?
Message
 
 
To
18/10/2002 22:47:58
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00711562
Message ID:
00713206
Views:
25
Hi Wally,

I'm afraid, we still didn't come closer to the solution of the mystery. One method, I can suggest, is: make a copy of the form.

Then try to remove objects and code piece by piece until you find, what was the problem.

I remember, my colleague had the same problem with one of her form. We looked together for couple of days and could not find what was causing it. Then one day she told me, it was MessageBoxX program (I found this program in UT - since we still haven't switched to VFP7, we use it for timeout messagebox). The problem was, that MessageBoxX added an object to the screen. I believe, Nick already pointed you to this thread and Christof Lange solution (though I solved it slightly differently).

So, it could be something like that.

Also, do you use any ActiveX controls on this form?

>>Still it could be some object, which is not properly released.
>>
>>Check out http://fox.wikis.com/wc.dll?Wiki~ManualGarbageCollection~VFP
>>
>>may be it would help.
>>
>>If you would not be able to find a problem, you can send your form to me, I'll take a look.
>>
>>Also, how do you call it? If you just run this form, does it have this problem?
>>
>
>Thank-you Nadya for your help. This issue is solved to my satisfaction. I will merely report to you how it went.
>
>First, I normally call a method in a custom 'application' object that takes charge of loading all forms. But I tried running the DO FORM syntax as you suggested instead and it performed exactly the same way.
>
>I looked into that link you provided with great interest. What I got from that is in your Destroy method you can call a custom method named 'GarbageCollect' where you run garbage collection code. In that code you can cycle through each object and issue the 'release' method or you can set to .NULL. value. However, the only object I have up is the form and it did no good to RELEASE That. That link didn't spell out how to do the VFP syntax for garbage collection. It called a 'garbagecollect' method on each object in the collection, but that must be a custom method.
>
>So, I closed out the data in the DESTROY and was left with an empty 'Unknown' datasession after the form is gone. This had no consequences for me, except that 2 of my maintenance procedures would not work after this happened. See in these 2 maintenance methods I'm issuing command 'CLOSE DATA' to close out the DBC's. When that CLOSE DATA command was issued on 1 of the 2 DBC's used in that form it went down as normal. But for the other one it just wouldn't close, so I couldn't do the maintenance. Then, I put code in to 'SET DATASESSION TO 2' and then CLOSE DATA and it would work. So, I just do that for about 15 datasessions now to cover thepossibility that the 'Unknown' datasession problem could be in something other than #2. So, now my maintenance works and Ihave no negative consequences from this little flaw. I still don't know what causes it, but it seems to have something to do with 1 of the 2 DBC's I use which are both used in that particular form. And these 2 DBC's and
>this exact form class are used throughout my application. Only on this 1 form do I get the 'Unknown' datasession that doesn't close out completely.
>
>Wally Noll
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform