Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deteremine how many datasessios are open
Message
 
To
08/06/1999 11:21:15
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00227341
Message ID:
00227460
Views:
21
Data sessions are bound with the forms. If you close all open forms, all data sessions will get released.

>>People ,
>>
>>Do you have a function where i can determine how many datasessions
>>are open
>>
>>Regards ,
>>david
>
>I've needed this in an application cleanup. If it crashes, close up all the outstanding datasessions before exitting VFP.
>
>The only way that I found to do it was to try SET DATASESSION TO for each session, then catching an error if it ocurred.
>
>Something like
>
>FUNCTION SessionCount
>LOCAL lcOldError, lnLoop, lnCount
>PUBLIC glFlag
>
>lcOldError = ON("ERROR")
>lnCount = 0
>ON ERROR glFlag = .t.
>
>FOR lnLoop = 1 TO 1000
> glFlag = .f.
> SET DATASESSION TO (lnLoop)
> IF NOT glFlag
> lnCount = lnCount + 1
> ENDIF
>ENDFOR
>
>ON ERROR &lcOldError
>RELEASE glFlag
>
>RETURN lnCount
- Jayesh
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform