You need to create a new class based on the DataEnvironment base class programatically. You can't use the class designer to do this. Somthing like this:
DEFINE CLASS MyDE AS DataEnvironment
...
PROCEDURE Init()
THIS.AddObject("Cursor1", "Cursor")
WITH .Cursor1
.CursorSource = "MyTable"
.Database = "MyDatabase"
.Alias = "MyTable"
.Order = "SomeOrder"
ENDWITH
...
ENDPROC
...
ENDDEFINE
HTH
>I want to programtaically create a new datasession, open a few tables, dow some work, then release the dataession restore the previous datasession as the current on.
>
>Basically, I want a new, private datasession programatically.