Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a primary field
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01034582
Message ID:
01034584
Views:
20
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform