Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting data from another datasession
Message
De
16/10/2001 12:52:20
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
16/10/2001 12:45:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00569060
Message ID:
00569121
Vues:
23
>If I use the set datasession to command then the select from my temporary cursor in the default datasession will also be placed in the default datasession then when my form again gains focus the datasession will change back to the form's datasession and neither of the cursors will be visible to the form.

Sorry I wasn't very clear. You just switch there to get data into something like an array, directly to lookup listbox etc (dbf('cursor') is likely to fail) and return to your own session. Here is a sample assuming a lookup wouldn't have more than 65000 elements :

* SQL server querying routine returned data to 'myCursor' which is in default datasession
* Form has private datasession
*Form.Load
lnsession=set('datasession')
set datasession to 1
select myCursor
afields(aStruc)
copy to array arrTemp
set datasession to lnSession
create cursor crsList from array aStruc
append from array arrTemp

*A listbox uses crsList as rowsource
*List.init
with this
 .RowSourceType=6
 .RowSource = 'crsList'
 .Columncount=3 && We only want to see first 3 cols
 .ColumnWidths='50,300,50'
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform