Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Uniqueness of Indexes - how do you handle this?
Message
De
03/07/2000 21:15:28
 
 
À
03/06/2000 15:54:34
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00376137
Message ID:
00387926
Vues:
30
Hi!
I've been in that situation too, I didn't know there was a GetNextKey procedure.
Yet there are other ways to work around Primary Keys, -I'm Not sure that They´re a any better than the GetNextKey Method, but at least they're easy to implement :) -

1. You can Use a Modal Form to get the User Key BEFORE you submit an Append Blankor Insert Into Command, so you can do a classif IF SEEK("WHATEVER") then return .f.

2. In the Valid Method use a SELECT (name_of_the_PK_field) FROM (name_of_TABLE) WHERE (name_of_the_PK_field) == THIS.VALUE, then a IF _TALLY > 0, you can return 0 with the respective MESSAGEBOX, and you're done.

I also recommend you that (JUST IN CASE YOU DIDN'T KNOW), to all your PKs in the right textbox of the index fields there is one field called FILTER, ALWAYS put a !DELETED(), filter to a PK, unless you want to have problems everyday with your users, if you dont, then you'll get problems with the PKS.

Hey, If anyone out there knows other way to handle deleted recs (please dont answer me BLANK 'EM FIRST!) PLEASE DON'T HOLD IT OUT!!!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform