Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with primary key.
Message
From
01/11/2002 12:39:37
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
01/11/2002 07:54:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00717718
Message ID:
00717909
Views:
11
>i have a table with a primary key. i use it in a form so i can make a new record and delete it. the problem is there is an error, with the primary key, if i make a new record after i delete one record in that table. anyway, i won't be able to 'PACK' the table coz i use a grid in the form to browse all data/record. i've tried using 'SET DELE ON' & 'SET FILTER TO NET DELETED()' but it doesn't work.
>what should i do?

Gloria, to go a little further with what Craig said, your primary key should be an automatically generated number that has nothing to do with the data. It's main purpose is to help with table joins. If there is a number that your users will enter that should be unique, then you should check for the existence of that particular number before allowing the user to save the record, and then ask the user what to do - whether to recall the old record or blank it out except for the number.
Previous
Reply
Map
View

Click here to load this message in the networking platform