Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Candidate Key - check before the table gets it
Message
De
12/03/2001 16:40:21
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
 
À
12/03/2001 16:29:52
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00484212
Message ID:
00484251
Vues:
13
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform