Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class based forms and Default DS
Message
 
To
17/01/2007 15:04:33
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01186390
Message ID:
01186408
Views:
16
>>>>>Hi everybody,
>>>>>
>>>>>Looks like the trick of sharing data session between two forms doesn't work with class based forms.
>>>>>
>>>>>I set my child form DS to be default and I have this form as a class and call it through menu manager DoForm method. It uses default DS and not the parent form DS as I hoped.
>>>>>
>>>>>What would be the best way to share a cursor created in the parent form with the child form in this case? Passing parent form's DE as a parameter or cursortoxml/xmltocursor?
>>>>>
>>>>>Thanks in advance.
>>>>
>>>>How about to pass DataSessionId of the parent form and use SET DATASESSION in the child ones?
>>>
>>>Yes, that's what I have in mind, though Help doesn't recommend to use this option.
>>>
>>>Strange, that it didn't work with class based forms, though. AFAIK I used this technique in MereMortals framework, where all forms are classes.
>>>
>>>BTW, there is a problem with this approach. I can pass ID to Init, but I need to see this cursor earlier, because it's a record source for the grid.
>>>
>>>On the other hand, in form's load the screen.ActiveForm is still the caller form.
>>
>>I knew there is something more :-))))))))
>>Grids doesn't like when you switch data sessions. But I think SET DATASESSION is much faster than CURSORTOXML/XMLTOCURSOR. You just must redefine your grid, if you pass DATASESSIONID as parameter and not use _screen.ActtiveForm.
>
>Grids do not like switching recordsources, even if it's the same alias in different data sessions :). Basically, grid recordsource should be still created in Load but could be populated in Form.Init event in this case.


You are right Edward,
But why this isn't a problem for other controls? :-)
(rhetorical question)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform