Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tables opened in default datasession instead of form dat
Message
 
 
À
18/03/1999 19:03:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00199548
Message ID:
00199759
Vues:
13
>I had a UDF that I called from within a form method. The code opened a table and always used the current datasession for the form. I moved the code to a Container object and the table gets opened up in the default datasession when the form calls the object method instead of the active datasession for the form. Why is this? Do I have to set the datasession before opening the table? Not sure why this would be different from a UDF.

Your container object probably exists in the default DS. Whenever you call the function, the table is opened in whatever DS the UDF exists in, not DS of the form calling it. What I did was add a DSID property to my App object (oApp.DSID) and set it to the DSID of the form before calling any functions. Then, at the beginning of a function, I set the DSID to the one stored in that App property before opening tables. If oApp.DSID is zero, I consider that as not changing to a particular DSID.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform