Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Candidate Key - check before the table gets it
Message
From
12/03/2001 16:40:21
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
12/03/2001 16:29:52
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00484212
Message ID:
00484251
Views:
14
>Thanks for the advice. Looks like I want to do this. I didn't test it, but I like to ask here before I change the code (there is a lot of others things involved in this 'Save' button...). Can you check below to see if it's correct (still change the SET DELETED?). Yes, am using CURSORSETPROP("Buffering",3,0).
>
>
SET DELETED OFF
>INDEXSEEK(m.id)
>IF FOUND()
>Messagebox('Sorry, can not use that ID'+CHR(13)+'This ID has not been purged from the database.',64)
>SET DELETED ON
>RETURN .F.
>ENDIF
>SET DELETED ON
>then the rest of the code...
>
>>This will work but I would make a couple of adjustments if you are using VFP 6. Use IndexSeek() instead of Seek(). By default, IndexSeek() will not move the record pointer and if your tables/cursors are using row buffering, it will not cause an inadvertent update.
>>
>>Also, you can specify the tag as the fourth parameter for IndexSeek(). You don't need to set up the tag and then reset it.

Chuck,
SET DELETED OFF
IF INDEXSEEK(m.id)
    Messagebox('Sorry, can not use that ID'+CHR(13)+'This ID has not been purged from the database.',64)
    SET DELETED ON
    RETURN .F.
ENDIF
SET DELETED ON
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform