Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why can't I change DataSession in a class
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00666133
Message ID:
00666270
Vues:
14
>I tried this:
>SomeForm.Method()
>  local lo
>  lo = NewObject('Save_Ds','Save_Ds.prg')
>  Set DataSession to SomeOtherDataSession
>  .... print a report from SomeOtherDataSession
>  release lo
>  .... continue some more in Form.DataSession
>
>Save_DS.prg
>  Define Class Save_Ds as Custom
>    nDS = Set('DataSession')
>    Procedure Destroy()
>      Set DataSession to this.nDs
>    EndProc
>  EndDefine
>
Why doesn't it work?

You're thinking about it the wrong way. When you create a Session object, only operations done from the object are in that session. However, in the first listing, you could do SET DATASESSION TO lo.DataSessionID, and it should work (as long as you save and restore your current datasession). In the class definition, I wouldn't change the datasession at all.

MSKB#Q248116 has more details about using the session class.
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform