Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Primary key
Message
 
 
To
22/01/2001 12:35:50
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00466733
Message ID:
00466742
Views:
9
>How come does my Primary Key does not trap the error UPON LEAVING the field itself? Shouldn't it trap the error regardless the =TablUpdate(), correct?
>
>Does the Primary supposed to catch the error RIGHT AWAY upon leaving the field, for ANY REASONS?

What error? Duplicated key? Is this in a view? Buffered table? If you are using a view, you should not populate the PK field. You should have a default value for your PK field in the table itself. My default value, for example, calls a stored procedure in the DBC. This default value is GetPrimaryKey('MyTableName'). The SP opens my Kounters table if not already open, locates the record that matches the table name I passed to the SP. I then lock that record, increment the kount, unlock the record, return the value.

BTW, if there is no record in the Kounters table that matches the table name passed to the SP, I add a new record to the Kounters table.
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform