Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Confusion over dataSessions
Message
 
À
14/01/2001 01:28:53
Jill Derickson
Software Specialties
Saipan, CNMI
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00463482
Message ID:
00463577
Vues:
17
Jill,
Like Ed I run my reports from a Private DS. However, since you wish to use the data that is in your StartUp form, why not change the ReportIt code from a PRG to a method of the StartUp form. When you call the method then it will automatically use the form's DS. You will need a way of moving back and forth from the StartUp form to the others - using a named form may be the simplest.

However, I really believe you should rethink this program. I have found that when all of the tables are loaded into the Default DS at the beginning of an app that the tables in the forms do not always get updated correctly. It seems that VFP will use a "USE AGAIN" and copy the data in the Default DS if the table is available instead of getting data from the server.

Also, do you have so many tables that opening them for reports adds substantially to the time to produce the report? You will still have to add filters, SELECTs, etc. to get the correct report data.

Just my opinion..

Barbara

>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
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform