Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine if a Datasession exists
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00140429
Message ID:
00140627
Views:
25
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform