Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: David Mustakim
  Where is David Mustakim?
 Jakarta
 Indonesia
 David Mustakim
 To: Sithu Kyaw
  Where is Sithu Kyaw?
 Yangon
 Myanmar
 Sithu Kyaw
 Tags
Subject: RE: Grid blank when reload the same form
Thread ID: 365756 Message ID: 365777 # Views: 30 # Ratings: 0
Version: Visual FoxPro 9 Category: Grids
Date: Monday, December 31, 2012 12:00:48 PM         
   


> > I am confused with your saying that your form.destroy (or grid1.destry) is programmed to release the grid's cursor/recordsource. If you just let the "autoopentables/autoclosetables" of the Data Enviroment's properties set to true then you should not need to release it manually. If you don't use DE but SPT instead then killing/releasing cursors should be even more straihtforward. In any case form only got destroyed when really released, not just hidden, and with that calling it again in anyway from anywhere - menu or whatever - would restore its initial settings of everything per design. If the grid goes blank while there is an error that relates to "dynamicbackcolor (setall)" then that should be corrected/resolved first but it has nothing to do at all with whatever you do on form.destroy
> >
> > David
> > ..
> > .
> >
> >
> >
>
>
> As I mentioned in my question, when I remove USE IN SELECT(Form.Grid.RecordSource) from Form.Destroy(), the problem resolved. That's why I'm curious to know.
> The cursor should be closed/destroyed when the form or grid is destroyed, otherwise I think it is still open when I open the other forms and it will affect them.
> The default values of "autoopentables/autoclosetables" are .T. in Data Environment, but I don't use Data Environment.
> What is "SPT" you mean?
>
> The problem only exists when I open the current form again and again from the menu.
> I would not use private data session because of some reasons.
>
> With Regards,
> profile for Sithu on Stack Exchange, a network of free, community-driven Q&A sites


SPT is short for Sql-Pass-Through, in simplified meaning it's just sql queries to form your cursors. Since you are not using Data Environment then my guess is in a way you are actually already using SPT.

If you don't want to use private datasession for whatever reasons then just make sure that you always take advantage of the fact that you can make different cursor/alias name for each different form/usage. It is of course best to always release/kill any cursor(s) which form(s) is released but I still don't understand why you have a problem doing that. Are you using any special class in you project/form, or probably formsets??

David
..
.

ENTIRE THREAD

Grid blank when reload the same form Posted by Sithu Kyaw @ 12/31/2012 8:26:49 AM
RE: Grid blank when reload the same form Posted by Tariq Mehmood @ 12/31/2012 8:52:30 AM
RE: Grid blank when reload the same form Posted by Samir H. @ 12/31/2012 9:44:41 AM
RE: Grid blank when reload the same form Posted by Sithu Kyaw @ 12/31/2012 10:02:51 AM
RE: Grid blank when reload the same form Posted by David Mustakim @ 12/31/2012 11:21:47 AM
RE: Grid blank when reload the same form Posted by Sithu Kyaw @ 12/31/2012 11:52:23 AM
RE: Grid blank when reload the same form Posted by David Mustakim @ 12/31/2012 12:00:48 PM
RE: Grid blank when reload the same form Posted by tushar @ 12/31/2012 11:30:41 AM
RE: Grid blank when reload the same form Posted by David Mustakim @ 12/31/2012 11:38:01 AM
RE: Grid blank when reload the same form Posted by Sithu Kyaw @ 12/31/2012 10:02:52 AM