Save/Restore and object??? 
Author Message
 Save/Restore and object???

SaveAsClass()
RemoveObject()
AddOject() or NewObject()

-Anders


Quote:
> Well if that was possible then I wouldn't have this problem to begin with.
> The way these guys designed the app, everything (and I mean everything)
runs
> in the default datasession.  Perhaps this is one of the things that is
> preventing me from doing the requery, or maybe it's that these particular
> views dont have any parameters....in any event it doesnt matter this is
not
> my real quest here.....

> Remember when I said "I was afraid someone would ask me that".....now you
> see why, eh? hahaha

> Soooo...back to my original question:
> On a form, I want to save, remove, then restore an object !!!!  Does
anyone
> know how to do this?



> > Victor,

> > I'll go along with what Remus says

> > just do the requery. Do not touch the recordsource.  You're grid will
stay
> > intact

> > **** do not ***| remove the recordsource....
> > | do the requery....
> > **** do not *** | put the recordsource back

> > ______________________________


> > | > I have a grid with a view as RecordSource
> > | > the requery() does not break the grid at all
> > |
> > | Interesting, because I've had the problem for years along with
everyone
> > else
> > | I've talked to.
> > |
> > | > are you changing/setting/resetting  the grid's recordsource
> before/after
> > | the
> > | > requery ??
> > |
> > | No I'm not...but that has been my workaround for years...
> > | remove the recordsource....
> > | do the requery....
> > | put the recordsource back...
> > |
> > | This is a well known foxpro issue I don't see how you can't be having
> the
> > | same problem.
> > |
> > |
> > |



Sat, 11 Dec 2004 16:08:24 GMT  
 Save/Restore and object???
Hi, Victor!
You wrote  on Mon, 24 Jun 2002 10:46:08 -0500:

 VA> Yes this is the same logic I use for the grids, but I want to do
 VA> this dynamicly for all the grids & comboboxes on the screen, and I
 VA> want to write it once to work on all my screens.

 VA> And as for making them invisible...that won't work because their
 VA> still tied to the datasources.

 VA> This brings me back to my original idea...cant you just SAVE an
 VA> object...REMOVE and object, then ADD the object you saved?  It
 VA> should be like 3 lines of code!!  It's like no matter how else I do
 VA> this it's going to be a hassle...arrrrrHHH!

Then maybe add this functionality to grid itself.

Maybe this solution can help you:
1) Add some property to your grid class (say lReconstructing)
2) Add this code to BeforeRowColChange event of this class:
IF This.lReconstructing
    NODEFAULT
ENDIF
3) When you need to breake down your table/view (Pack, Zap or soma else)
just set lReconstructing property for you grid to .T. and switch back to .F.
after you complete operation.

And you can even use ThisForm.SetAll () or SetAllX class (from ffc or
wizards, don't remember exactly) to manipulate all your grids.

WBR, Igor



Sun, 12 Dec 2004 02:57:00 GMT  
 
 [ 17 post ]  Go to page: [1] [2]

 Relevant Pages 
 

 
Powered by phpBB® Forum Software