>In my error handling program, I would like to revert all the tables opened in the system. I use AUSED() to create an array of the opened tables. However, it gives me the tables without telling me in wich datesessionID it is so when I do a select on the tables, it doesn't recognize them? Any way to get the datasessionId for an opened table?
>
AUSED() is scoped to the current data session if no data session is specified in the second parameter of the function call. If you need to close the tables of all data sessions, you need to iterate through the data sessions and examine and close them separately.
AUSED will be upset if you specify an invalid data session id, the approach I'd take would be to iuterate through the _SCREEN.Forms collection, get the datasession, and do the AUSED, something like:
LOCAL i, oForm, aAliases[1,2], nAlias
IF _SCREEN.FormCount > 0
FOR EACH oForm IN _SCREEN.Forms
DECLARE aAliases[1,2]
aAliases = NULL
nAlias = AUSED(aAliases,oForm.Datasession)
ENDFOR
ENDIF
>thanks
>eric.