Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Confusion over dataSessions
Message
From
14/01/2001 08:33:08
 
 
To
14/01/2001 01:28:53
Jill Derickson
Software Specialties
Saipan, CNMI
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00463482
Message ID:
00463506
Views:
20
Hello Jill

I am still a bit new to data session usage as well and hopefully a heavy hitter will come on soon with a definative answer for you.

However I suspect that because you have forms open with private data sessions it is defaulting to the private data session of your form because that form becomes active again as soon as your SET DATASESSION command has finished.

Perhaps if you used the DEACTIVATE event for your form before you issue SET DATASESSION this might do what you want.

However I have been told that the only safe place to use SET DATASESSION in an app is within the load event of a form.

Hope this is of some help




>I must be making a mistake in assuming how * I * think things should work here - I need help!
>
>I have a StartUp form that runs in the Default DataSession; it opens all the files that will be used in reports, etc. in it's Data environment. Users can launch other forms from this StartUp form or from the menu.
>
>Every other non-modal form in the system uses Private DataSessions.
>
>My reports are called from the REPORT menu, and all call ReportIt.Prg, w/a parameter that specifies what report should be run.
>
>I want all my reports to run in THE Default DataSession (1), no matter what other forms are open. If other forms are open, I thought, that to allow reports to run in DS 1, what I'd have to do is:
>
>- at the beginning of ReportIt, do the following:
>
>nSaveDataSessionID = SET( "DataSession" ) && save the current data session
>Set DataSession to 1 && the default data session, used by the StartUP form
>
>- at the end of ReportIt, to restore to the previous DS:
>
>Set DataSession to ( nSaveDataSessionID ) && restore current data session before RETURNing
>
>
>This doesn't work for me...looking at the debugger, and using a WAIT WINDOW to display values, the DS does not get changed. I tried, at the beginning of ReportIT:
>
>nSaveDataSessionID = SET( "DataSession" ) && save the current data session
>Set DataSession to 1 && the default data session, used by the StartUP form
>nt = SET( "DataSession" )
>wait window alltrim( str( nt ) ) + " is the datasession"
>
>The results of the wait window display is 2! I feel like I'm missing something obvious, can anyone help point it out?
>
>TIA J
Previous
Reply
Map
View

Click here to load this message in the networking platform