Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a New User Defined Primary Key
Message
From
25/09/2000 04:07:40
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00420360
Message ID:
00420375
Views:
17
Russel,

>In an Client-Server application where the customer insists on a specific Primary key (say ID C(10)), I wish to discuss the pros and cons of the following methods of inserting a new record.
>
>(a) Check if the new primary key (Say ID = "JFK"), exists in the Backend table using INDEXSEEK or SELECT-SQL, then lock the WHOLE table while the INSERT is being performed.
>(b) Try to insert the record without checking, trap and deal with any error returned ie "Duplicate Primary key"
>(c) Any other suggestions?

IMO, (b) is the most secure one, With (a) you still cannot guarrantee for 100% duplicates can't exist. If with (a) somehow a duplicate was inserted you won't notices and could get odd behaviour in your app.

Walter,
Previous
Reply
Map
View

Click here to load this message in the networking platform