Roelaux,
If it is working then you may be placing too much emphasis on the what is going on with the View window. Datasessions by nature do not really have names, only numeric identifiers. There is no way to take a datasession name and use it to set the datasession.
Having said that, I don't know why the name is changing. It doesn't on simple tests I run on my machine (VFP 6 SP3). But the thing to remember is the ID never changes (it is always 2 in this case) and you can use it with SET DATASESSION TO ??.
>Jim,
>
>Thank you for the reply. I'm still having a problem with the Private data sessions and default sesion. I really do not understand what is going on. Therefore I'm at a loss for words about explaining the problem.
>
>What I'm doing is using the default data session to run reports and track user settings. When I initialize a form (frmmyform1), I'm using a private data session. VFP assigns the name of that session as the name of the form (Frmmyform1(2)). If I call another form (frmmyform2)from the first form the session is renamed (Frmmyform2(2)). When I'm done with the second form and release it, I call the gotfocus of the first from and refresh it. The private data environment is now named (unknown(2)). The form data is being displayed correctly. The form is refreshing and the record point is moving to the correct record.
>
>frmmyform1.datasession=2
>frmmyform2.datasession=1
>
>
>
>
>
>>Roelaux,
>>
>>If I can, I put all of my report data generating code in the "Init" method of the report's data environment. That way, all you have to do is "REPORT FORM ..." and the DE "Init" will do the rest. You can send parameters to the DE Init to handle situation specific stuff and you can kill the report cursor in the DE's "Destroy". Now your FRXs are "encapsulate" their data.
>>
>>Just a thought !
>>
>>P.S. In my opinion, Fox cursors are a beautiful thing. All of my apps now use a SQL Server back end and I use cursors extensively to hold extracted data. I don't mind defining them up front using CREATE CURSOR ... I use predefined cursors as record sources for grids. If I need to refill the grid cursor, I just ZAP IN
and refill it ... no need to worry about blowing the grid record source property.
>>
>>Toodles,
>>Jimmy D.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao