Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP5.0 doesn't ignore deleted files
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00241343
Message ID:
00241401
Views:
10
>I am working in VFP 5.0a and have a 2.6 program running. The program is a screen for data entry. When I delete a record the program will mark the record for deletion. That part works great, the problem is when I input another record with the same value in the primary key field I get a "uniqueness violation". I understand that a primary key needs to be unique but why is VFP not ignoring the the deleted records? I used SET DELETED ON in the setup code and within the 2.6 program but it seems to make no difference. How do I get VFP5.0a to ignore the deleted records so that I may reuse a value within the primary key field?
>

Because the value of the DELETED() flag is not an element of the primary or candidate key. The importance of the DELETED() flag is not constant (IOW, SET DELETED OFF and VFP is supposed to ignore the fact that it's been deleted) so it can't be used as a filter for the primary or candidate key unless you specifically scope that key to always consider the DELETED() function - either with a FOR clause, or by concatentating or modifying the value of the key field using the DELETED() flag. And the second will break as soon as you delete the second occurance of a key vale...

>Thank you,
>Jennifer from CA
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
Reply
Map
View

Click here to load this message in the networking platform