Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataSession
Message
 
À
27/10/1998 09:55:00
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00150175
Message ID:
00150965
Vues:
18
Thanks for the answer. I had tried something like that but not always works. I assume that it is because for small tables a real dbf is not created. What I have noticed is that if I open a view in the default datasession and the open it again in the private one the query is not reevaluated. I haven't found anything to explain this behavior but it seems to work. The code I am using in my "zoom" combo base class is:

* open the table
* if we are using it with zoom_DataStore = .t.
* open it in the default datasession
if ThisForm.DataSession > 1 and .zoom_datastore
oldDS = set("datasession")
set datasession to 1
if !used(JustStem(.zoom_cursor))
* set talk on to show query progress
oTalk = oSet("talk","on")
set message to "Running query " + .zoom_cursor
* open the cursor in the default datasession
use (.zoom_cursor) in 0
* and set the flag for closing it on exit
.zoom_CloseOnExit = .t.
oTalk = .null.
set message to
endif
set datasession to oldDS
endif
* and now open the cursor in the form datasession
if !used(JustStem(.zoom_cursor))
* set talk on to show query progress
oTalk = oSet("talk","on")
set message to "Running query " + .zoom_cursor
use (.zoom_cursor) in 0 again
oTalk = .null.
set message to
.zoom_CloseOnExit = .t.
endif



>>There was a neat trick to do it, several months ago (fast Eddie, maybe). Went like this, assuming you have everything open in default datasession, and you want to open it once more for your combo:

>>lnDSession=this.datasession
set datasession to 1
select (dataSourceForCombo)
lcPhysicalTable=dbf()
set datasession to lnDSession
select 0
use (lcPhysicalTable) again alias ComboDataSource
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform