Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating a primary field
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01034582
Message ID:
01034584
Vues:
21
>I have a table which will store information with regards to test results. I want to make the field LabRef unique. So if they copy the record and dont change the labref it will not allow them to store the record. I have played around with candidate index but cannot get it working. Can nybody help me in how to do this?
>
>MAny Thanks

Neil,
After inserting the record you must change the record pointer so the error to be rised. Make the Index Primary or Candidate (if you have primary index already)
There where you insert the record:
INSERT INTO .....
m_record  = recNo("YourTable")
TRY
  GO TOP
  GO TO m_record
CATCH 
   Message Here
   TABLEREVERT(.t.)
ENDTRY
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform