Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Losing Alias When Class Called - Only From One Form
Message
From
09/10/2001 09:41:19
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00565864
Message ID:
00565885
Views:
20
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
Map
View

Click here to load this message in the networking platform