Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Primary Key
Message
From
31/12/1998 07:25:50
 
 
To
31/12/1998 03:52:28
Jocylyn Sy
Freelance Programmer
Cebu, Philippines
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00171828
Message ID:
00171840
Views:
26
>Happy Holidays Everyone!
>
>I've noticed that although a record has been deleted,
>when you enter the item again, Foxpro still complains
>that the item already exists when item is primarily key.
>
>I was wondering if there is a way to allow the
>re-entry of a primary key item that has deleted.

A records that's been flagged as deleted still exists as far as it's key values go. If you're going to have to reuse keys, I'd recommend that you either change the value of the primary key to an arbitrary, unique nonsense value on deletion, or check to see if the record already exists and has been deleted before INSERTING, and if necessary, RECALL the record and then replace the appropriate values.

I tend to use surrogate primary keys (keys that are unique and carry no detail about the record other than providing a unique identifier, typiczlly an integer field that is unioquely assigned when the record is added) and don't recycle the keys.

>
>Thank you.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform