>I am using a form with private datasession.
>The form do not have any tables open. In the Load Event I open the tables.
>
>In the Init() of the form I want to use the table but the DataSessionID is set to 1.
>
>If I suspend the excution in the init() I can see the DataSession # 4 created for my form but the DataSessionID is not set to 4.
>
>Any one know when the DataSession is set to my privated datasession?
Unless you change DS in code, it should be set automatically, when form loads.
At least, I always open tables in form's load and never had a problem. Usually I do it this way:
main program of application
parameters tcFileName, tcOperation
do form myMainform
Form's load:
if !myFormInit(m.tcFileName, m.tcOperation)
return .f.
endif
return dodefault()
I do opening of tables in myFormInit program.
If it's not broken, fix it until it is.
My Blog