Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for duplicate keys when entering data in form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00252239
Message ID:
00252268
Vues:
9
Hi Bruce,

>I am still new to VFP programming.
>It appears that to add a record to a database via a form, you APPEND BLANK and then have the user enter the new data.
>I did not see any controls that would generate an error message if you tried to enter a duplicate key as happens with BTrieve and other databases.

This behavior, in my experience, shouldn't even be touchecd by your forms, but all handled by the database. In order to prevent multiple key, create an index on an integer asn set it as primary. This will be your primary key, your users should not even know this field exists. The way this mantians its uniquness is handled by the DEFAULT VALUE option in the table designer. For a better understanding check your VFP Solutions Samples, and under Database or something. You should find the ID field example.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform