Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unique ID increment
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00128168
Message ID:
00128208
Vues:
25
>In MS Access there is a data type in a table called 'COUNTER'. This is a number that is increased with every new record, and is a unique number. I noticed that there isn't a data type in FoxPro like this. How are you handling unique incemental ID's in a FoxPro table?

In the record validation rule for the table I do something like this
IF EMPTY(TheMainKeyField)
  USE (DBF()) AGAIN IN 0 ALIAS AutoNumber ORDER TheMainKeyIndex
  GOTO BOTTOM IN AutoNumber
  REPLACE TheMainKeyField WITH AutoNumber.TheMainKeyField+1
  USE IN AutoNumber
ENDIF
HTH!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform