Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help on duplicate key
Message
From
02/04/2005 09:45:12
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01000949
Message ID:
01000978
Views:
17
>Hi to All,
>
>I need help about this 'scenario'.
>In a Data Form, I manage an MS SQL Table with a PK.
>I manage this Table with a Cursor Adapter, created with CA Builder (is a class).
>How can I to verify, when the record is new and immediatly after I enter the primary Code, that this Code isn't duplicate ? This PK isn't automatically generated.
>The control on the duplicate key is currently active only when I try to save and this isn't interesting for me.
>
>Thank you for help and any code suggestion.
>
>Best Regards

You might SELECT data from the table, for records that have the primary key. If more than zero records are returned, you will have a duplicate.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform