Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Private DataSession
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00381943
Message ID:
00382006
Vues:
26
>Milford,
>
>Try this ... pass the form as an object, or maybe just its data session id to your UDF that creates the cursor and runs the SQL to populate it, etc. In your UDF, set the current data session (SET DATASESSION TO ) to match what you passed in. Then Create your new cursor and run whatever SQL you need to populate it. When you return from your UDF back to the form (I think you can even "reset" the current data session in the UDF before you "RETURN"), your new cursor should be visible in the form's datasession.
>
>Best wishes,
>Jimmy D.

You definitely need to set the DS back to what it was at the end of the UDF. If you leave the UDF in the private DS of the form, the DS can not be released when the form is destroyed.
procedure myudf
*
lparameter tnDSID
if vartype(tnDSID) <> 'N' or tnDSID < 1
   return
endif
local lnOldDSID
lnOldDSID = set('datasession')
set datasession to (tnDSID)
*
* create your cursor here
*
set datasession to (lnOldDSID)
return
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform