Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Base Grid on Cursor -- Any problems? Any Tricks?
Message
 
 
To
14/01/2000 18:13:51
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00317290
Message ID:
00318496
Views:
32
Erik,

>>>If you create a cursor in the Form.Load event, it will be available when the grid instanciates. I do this all the time, and retain grid property settings. Just remember to blank out the recordsource before recreating the cursor on the fly, and set it back afterwards.
>>
>>Thanks. I did just this way and my grid is working well.
>>
>>One other question: anyway to pass the cursor to the main app where I have a method to do a batch update in DS 1? I tried passing DBF("curUHSTAT") and when I tried to open it in the goApp method it said that the table was being used exclusively (which make sense).
>>
>
>
>You can't pass a cursor. You can switch datasessions to make it visible to other processes with SET DATASESSION, but every time I have seen somebody tryingto use this, its because of a funky design. If you create the object that manipulates the data from an object that lives in the datasession, then the created object will live in that datasession, and have full access to its contents. Having to SET DATASESSION to see cursors in different areas is sort of like, IMHO, using public variables. If your variables are created in the right routines in the first place, you don't need them to be public.

Again, sorry for jumping into this thread, but this question is very interesting to me too. I understand, if a form has it's own private DS, there is no way to pass it's cursors back. So, what's the solution here? Preparing these cursors in the calling program? We can not pass an array back in UnLoad method, Ed Rauh already told me that. We can create a custom object with an array property, instanciate it before the form's call and then retrieve an array of our changes. Right? But for me this method seems to be combersome. My question is: what could be other solutions in this situation?

TIA
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