Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Uniqueness of Indexes - how do you handle this?
Message
From
03/07/2000 21:15:28
 
 
To
03/06/2000 15:54:34
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00376137
Message ID:
00387926
Views:
28
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!!!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform