>I would like to know the number of active data sessions for looping through in an error handler. If using
>
>for lnDS = 1 to 10
> set datasession to lnDS
> (code to log table useage in each session)
>...
>endfor
>
>an error occurs when trying to set to invalid data sessions. To make matters worse, the error "Session Number is invalid" is one of the VFP errors that always displays, even when there are active error handlers or events. Any suggestions for knowing the number of sessions in advance, or not displaying the error is appreciated.
An ON ERROR handler can certanly trap error 1540 (Session Number is invalid).