Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Auto-incrementing a number field
Message
De
22/12/1998 12:06:58
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00168371
Message ID:
00169692
Vues:
24
>>Sorry Dan, must have hit the enter kit by accident on my last response.
>>
>>Any way, here is my suggestion:
>>
>>In your form init method:
>>
>>SELECT ;
>>MAX(id_field) ;
>>FROM table ;
>>INTO ARRAY aHighestID
>>
>>IF _TALLY > 0
>> THISFORM.object.value = aHighestID[1] + 1
>>ELSE && No records on the table
>> THISFORM.object.value = 1
>>ENDIF
>>
>>This should do it for you.
>>
>>Good luck
>
>Many thanks Juan to you and others who helped me with this...
>although there were many very good syggestions, your example sure helped me to finally resolve this issue!
>
>This is why I think the UT is the greatest thing since sliced bread!!
>
>Thanks to all,
>Dan

Dan, I'm sorry to interrupt here, but this way is highly suspicious in multi-user environment.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform