>I've found that when VFP6 errors out, it can leave datasessions and tables open. A CLOSE DATA will take care of any tables open in the CURRENT datasession, however, I wish to close ALL tables, regardless of what data session they are in.
>
>It's not quite as simple as this, however:
>
>For X = 1 to 255
> Set Datasession To X
> Close Data All
>EndFor
>
>Because VFP gives you a nice little error if the X datasession doesn't exist. Now of course I could simply trap for this error and ignore it, but that's not very elegant.
>
>So, does anyone have an elegant solution for this problem? I would have thought there would be some Array command like AFIELDS, AUSED, ADATABASES, but I cannot find one for data sessions.
>
>Thanks
There's ASESSIONS( ) Function in VFP7.
--sb--