Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Hi John,
>How do I pass a reference to the private datasession to a method in my application class?
You can pass the ID:
oApp.NewKey(cTablname, Thisform.DataSessionID)
>oApp.NewKey(cTableName)
How do you use this? Does this method use a NextID or similar table that can get the NewKey without haveing the table? If so, you may think about doing the REPLACE or INSERT on the form, and have NewKey just return the new key, not actually populate it:
replace ID with oApp.NewKey(juststem(dbf(cTableName))) in (cTableName)
Then the datasession doesn't matter because you don't need to actually touch the field.
BTW, is this for a Primary Key in a table? If so, its usually handled in the Database Default Value for the field.
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