General information
Category:
Coding, syntax & commands
>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.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only