Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Switching DS in the form
Message
De
08/10/2008 18:03:11
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01353495
Message ID:
01353715
Vues:
16
>>>>Right now the process is just in a program. I intend to re-write it as a class, but for the time being I thought of just using a wrapper to create a session based class, switch to its datasession and then run this program. This didn't work.
>>>>
>>>>I'm afraid that even if I create it as a class, I would still have the same problem with my form. Are you sure that making this program a class based on the session is going to work?
>>>
>>>In the session based class add a method that runs your processing prg. It'll run in the private DS of the class.
>>
>>I exactly had the same problem as William has. In my case the problem was the grids of the form lost their databinding. Either I don't understand what you mean, Sergey, so forgive me then, or otherwise it seems to me it cannot be solved that way. Class or not. It seems VFP-behaviour to me. Switching to an other datasession means that when you come back to your original session the bindings have been lost. But maybe you mean something different and there is some solution after all.
>>
>>Lennert
>
>Did you try moving focus out of the grid? Though we tried it too and it didn't help.

In my case the focus was not on the grid (it was on a textbox) but the grid complained.
But in the meantime I think I understand what Sergey wrote, and I think he is right.

- Before the form opens, declare an new sessionobject
- Define a userdefined method for the session
- In that method of the session call your prg.
- Now from within your form, call loSession.Yourmethod. Now you don't do an explicit "set datasession to", but because the code is from within the sessionobject, it will operate in that session. Implicit you switch sessions now, and thereby may avoid the problem.

I think this is what Sergey meant. I didn't test it, by the way. If this is it, S. deserves the stars...

Lennert
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform