Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detect Auto Incrementing Fields
Message
De
31/08/2004 13:22:31
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00938100
Message ID:
00938112
Vues:
21
John,

You can open the table as a low-level file and look at the first character of the file...it is '1' if it has an autoinc field, otherwise it is '0'.

Look at "Autoincrementing Field Values" topic in VFP8.

Or, you could try to change the value in that field, and catch the error. The field is readonly if it is autoinc.

>I am using the following code to update a field to auto incrementing. How can I test to see if the field has already been changed so the following code doesn't get continually run?
>
>
>USE Customer IN 0 EXCLUSIVE
>SELECT Customer
>CALCULATE MAX(CustId) TO lnNextValue
>ALTER TABLE Customer ALTER COLUMN CustId I AUTOINC NEXTVALUE lnNextValue + 1
>
>
>Thanks
>
>John
Steve Gibson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform