Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine if a Datasession exists
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00140429
Message ID:
00140627
Vues:
26
>>Is there a way to determine if a datasession is open/valid?
>>
>>Ie
>>IF DATASESSIONEXISTS(x)
>>SET DATASESSION TO (x)
>>...
>>ENDIF
>>
>>Wayne
>
>Not in VFP 5 (don't know about 6). The best I could suggest is have a property in an App object to track this.
>
>In the App class
>oApp = creatobject("AppManager") && whatever
>oApp.DSIDs = ""
>
>In form class Init:
>
>oApp.DSIDs = oApp.DSIDs + ";" + padl(This.DataSessionID, 3, "0") && pad with zeros
>
>In form QueryUnload
>
>oApp.DSIDs = strtran(oApp.DSIDs, ";" + padl(This.DataSessionID, 3, "0"), "")

Many app objects also store a reference to forms that are currently displayed. You could use the concept above and roll through the form references to get the .DataSessionID property.

Steve
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform