Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Violating key
Message
 
To
08/12/2004 10:41:23
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 6
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00967754
Message ID:
00967762
Views:
7
The record is still in table no metter that you not see it. You are SET DELETED ON & all deleted records are ignored. Before INSERT the new record You must check If the record with the same key is already exists & if it exists & deleted recover it.

*** Before inserting
SELECT MyTable
SET DELETED OFF
SEEK MainKey ORDER PrimaryIndexForThatTable
IF FOUND()
IF DELETED()
RECALL
REPLACE....
ELSE
MessageBox("The record with the same key already exists")
ENDIF
ELSE
INSERT INTO ...
ENDIF
SET DELETED ON



>I am using the VFP tables. I have a situation where, you enter a record and the user enters a unique key. The record is then deleted. Later another record with the same key is entered. an error occurs regarding the uniqueness of the key. Why does this error occur. When I browse the VFP table I do see that the old record is there and marked for deletetion. Is there a way to avoid this problem with out packing and reindexing the table?
>
>Thank you in advance
>Christine
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform