Information générale
Catégorie:
Programmation Orientée Object
>At start up I create an application object - oapp. In this object I have a method that operates on data- something like:
>
>if cust.type='Business'
> return something
>else
> return soemthing else
>endif
>
>which is manipulating data in an open table. If the form this is called from uses a private datasession then the method does not see the cust table. In other words, it appears that the oapp object is scoped to whatever datasession was active or the default when the object was created. Is this right or have I just messed up somewhere? If it is right, why was it designed this way? I am perplexed.
You are correct. This is how the data works. I was confused about this issue also about a year or so ago. Yes, the oApp will only see the databases involved in the data session it was created in. What you may want to do, is to create a baseclass FORM with the custom methods you want to be applicable to each form that may be in its own private data session and base all your forms off that. Or you can create a custom class with some data specific functions and add that object to the form as needed and reference as
Thisform.MyDataControl.CheckData()
HTH
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement