Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing cursors between datasessions
Message
From
29/12/2005 10:40:58
 
 
To
29/12/2005 10:32:48
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Miscellaneous
Thread ID:
01081341
Message ID:
01081660
Views:
8
Mike --

I have some problems with assuming that a cursor name is unique ... most of my forms create their own cursors. How would you manage multiple occurrences of this form? Assigning some sort of random name to these cursors?

Jim


>Hi James
>
>>You might consider putting that data into cursors and having the forms use the default data session. You might also consider having that object instantiated within the data session of the first form and have other forms called by buttons on the first form. Such called forms can adopt the data session of the first form.
>>
>>Have tried for some time to avoid having forms share data sessions. Most of my forms create cursors which are then used in grids (yes, heaven forbid, my apps are based on grids, but they're the example of when using grids are appropriate). Sharing a single data sessions then causes major headaches with replication of cursor names.
>
>I think many people are blindly avoiding sharing data sessions. There are potential problems, but then what is free of potential problems? It's my contention that everything has it's place, even grids and SQL.
>
>What I do is assume that any cursor name is unique throughout a chain of forms. The first form in the chain has a private data session. All forms called from that first form participate in that data session. IOW instead of only having multiple instance forms, I have multiple instances of chains of forms.
>
>So when forma calls forma1, forma1 does not open already open cursors. Performance is very good.
>
>>
>>Thanks for the suggestion in any case,
>>
>>Jim
>>
>>
>>>Hi James
>>>
>>>>I understand that I can't pass a cursor between datasessions. I have read suggestions to use CursortoXML and back again, but I find that XMLtoCursor can be very slow for an interactive session (25 seconds is way too long for 2900 records). I'm looking for alternatives.
>>>>
>>>>Background: I have a class, created at the start of a user's session, which downloads a pile of data and creates summary information from it. All of my forms, with their own private datasessions, talk to this class to get the data they need. For all uses except one, using CursortoXML and back work fine, since the number of records involved is quite small ...
>>>>
>>>>Thanks in advance,
>>>You might consider putting that data into cursors and having the forms use the default data session. You might also consider having that object instantiated within the data session of the first form and have other forms called by buttons on the first form. Such called forms can adopt the data session of the first form.
Jim Nelson
Newbury Park, CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform