Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Category:
Forms & Form designer
Hi Vlad,
Exactly! I had no idea that the data session on creation was retained. I assumed that the default data session would be used. I wonder why? I would think that the it would use the current data session.
I went with the first solution and everthing works fine for all forms. Thanks!
Renoir
>Hi!
>
>oApp is a public object, right? Thus it works in the default data session. When you have a form with private data session, all aliases in it are opened in that data session. When you call oApp object from such form, data session is switched by VFP automatically to the data session for that object (oApp) - the data session that was current during that object creating. In your case ther are 2 solutions:
>
>1. Put a functionality to the separate object and put that object into your form class, so all forms will have it. then call that functionality in the form. This will assure data session is the same.
>2. Pass additional parameter to all functions in oApp object that work with data. In the oApp fist lines of code after parameters statement will be code to use SET DATASESSION command to set correct data session.
>
>First approach is better.
>
>HTH.
>
>>I have a oApp class that receives two parameters in order to handle changes to records (save, delete, etc). From one form everything works fine, but from another as soon as the lParameters statement is executed (or at least that is the next line after the call to the class from the form) the Alias is lost. What could cause an Alias to drop given this situation? Thanks!
>>
>>Regards, Renoir
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only