Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set datasession blues.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00207254
Message ID:
00207984
Vues:
10
Ah! I see where I'm confused now. I change the datasesion in a generic tableupdate method of oApp. That's why the datasesions change when I access the nextkey method ...

Thanks.

Still does not explain why set datasession is ignored in the form though :)

Ah well...

Marc


>I do not have the Kounters table open in other DataSessions. The Kounters table is open in the DS where oApp was instanciated (i.e., the default DS). All I care about is having a unique integer number returned to the calling form's method for use in whatever table I need it for. All my GetKeyID function needs is the name of the table and field to return a value for. It locates this info in the Kounters and returns the next integer number to the calling method.
>
>>Call it age or skin or worse, but I still am confused :(. I understand that oApp does not have to access the table for which you need a key, but I am under the impression that you must be playing with data sessions in order for oApp to access the Kounters table. If you do not do anything, and you call an oApp.method from a form, you will not be in the correct datasession, and get an error no?
>>
>>We do the same thing basically, but now I wanted to access the Kounter table from the form directly (you know me and programatical correctness ...) and _that_ does not work because set datasession is ignored.
>>
>>Thank you for your patience :)
>>
>>Marc
>>
>>
>>
>>>oApp can not see the table and does not need to. Because I am passing the TableName and the name of the Key field to my GetKeyID function, I do not have to see the table I am getting an ID for. My Kounters table has 3 fields, TableName, KeyName and Kount. I issue a Locate for TableName == lcTableName and KeyName == lcKeyName. I lock that record then increment the Kount by 1 and return that value to the calling method.
>>>
>>>>Hi Marc,
>>>>
>>>>I'm probably missing something, but is you are not in the default datasession, how come oApp can see the table?
>>>>
>>>>Thanks for caring,
>>>>
>>>>Marc
>>>>
>>>>
>>>>
>>>>>Marc:
>>>>>
>>>>>I do not deal with DSID in my oApp.GetKeyID method. What I pass to the method is the TableName and the KeyName. My primary key generator searches my Kounters table for a matching TableName and KeyName. If not found, I append blank and start the Kount at 0 [next ID will then be 1 -- I track the last used number]. My oApp object used the default DS [1].

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform