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 18:21:41
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00565864
Message ID:
00566247
Views:
13
>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

Vlad,

I too have had a similar situation, but I fixed it by way of workaround in the load() of a new form - placing a call to setdatasession to... is this what you mean in your first solution? or is there some different way you have in mind?
TIA
Ric
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform