Mark,
Thanks that does seem to work, I do have to USE to get rid of the cursors otherwise they hang around out in an "unknown" datasession afterwards
>If I understand your question, your method will always remain in the DS that its parent is in. Session is just another object and has no affect on the method that created it. You would need to add another line of code to switch to the DS of loSession when creating the cursors.
>
>loSession = createobject( "session" )
>
lnDSID = loSession.DataSessionID
>lnOldDSID = set('datasession')
>set datasession to lnDSID>create cursor TheRootElement ( ... )
>scatter name this.TheRootElement
>create cursor ASubordinateElement ( ... )
>scatter name this.TheRootElement.ASubordinateElement
>
set datasession to lnOldDSID>loSession = .null. && poof all the cursors and return to the priv ds