Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The Session object and Grids
Message
 
 
To
20/02/2009 12:55:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01380409
Message ID:
01383143
Views:
48
>>Is there any way to use the session object harmoniously with grids? I wrote a control that's based on a container. It creates a Session object and opens all it's data inside the session. Within any of the controls methods that needs access to the controls data I switch the DataSession to point to the controls Session, do whatever I need to do, and then reset the datasession to the default. The reason this is important is that there may be any number of these controls on a form and they all need to have a private copy of the data.
>>
>>This works great, but... When I put the control on a form that contains a grid, every time I switch the datasession within my control the grid looses its RecordSource. This is understandable since the grids RecordSource is going out of scope, but, it's a real dissapointment because it makes the session object, at least for my purposes, useless. I can't believe that there isn't a way around this problem... How do you give a user defined VFP control it's own DataSession without perturbing the other controls in your system?
>>
>>It seems so simple. There should be a way to reference your data based on the datasession the cursor resides in. Something like:
>>
>>oDataSession1.MyTable.TableField1
>>
>>Any ideas?
>>
>>Thanks,
>>
>>Steve
>
>VFP cannot split a form into two or more datasessions.
>
>When you set the datasession into one form's method ( at any level ) the whole form go into that datasession.

Thanks a lot. In other words, we can instantiate a session based class and do processing it it, but we can not do using SET DATESESSION ID.

Or may be there is a way to temporarily unbind all controls?
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