It has been my experience that if I use the objects AddObject/NewObject method, I cannot get a datasession to work the way I think it should. However, if I create a property on the Object I want to have the separate datasession (including a custom object) and assign the datasession object to this property, then I can get it to work the way I think it should. I'm always careful to include in the Destroy method a line of code that will store NULL to the datasession object property so there are no dangling object references. Unfortunately I'm not where I can lay my hands on the exact lines of code but as I recall after you say Container.objDataSession = CREATEOBJECT('session'), you then need to tell this instance to setup a private datasession. After that as you click into the object, the datasession should auto change. If not you can always add some got focus code to set the objDataSession to the right one.
You can email me at
lhdsystems@bellsouth.net if you need some sample code. Please be sure to put something in the subject line about VFP and Universal Thread so I won't delete the message as spam.
Stewart Crisler