Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00303412
Message ID:
00303486
Vues:
13
Thanks for your reply, now I know where to put the code.
I noticed in your code snippet, you are setting the key the hard way. I use a stored procedure as the default value for my primary keys

function new_key
parameters tbl_name, key_field
private newkey
select max(&key_field) from &tbl_name into array temp
if _tally >0 && found records
newkey = temp(1)+1
else && empty table
newkey = 1
endif
return newkey

then in the key field's default value I put new_key("sometbl","keyfield")
and I never worry about unique keys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform