Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert overwrites existing record
Message
From
28/04/2003 15:33:24
 
 
To
28/04/2003 15:11:36
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00782413
Message ID:
00782427
Views:
10
>Ok, this is a weird one. I have an order entry system that has a Order Header Table and a Line Items Table. The user can start an order and then add multiple line items. This part works fine. Occasionally, however, adding a new line overwrites an existing line (always from a different order). When the user clicks the "New Line" button, the code finds the next available key and then performs a SQL Insert command to insert the new line. But, when this bugs crops up, even the Primary Key is changed to a new key. Nowhere in the system do I have a replace that replaces the primary key.
>
>I know that an old record is getting overwritten because I am using TakeNote's FoxAudit, and it shows when it happened and who did it, the value it was before and the value it changed to.
>
>By all reasoning, this can't be happening, but it is. An insert command is overwriting an existing record. Does anyone have any suggestions on this???

Might be a corrupted index. Rebuild if possible (i.e. DELETE TAG ALL, etc.) (may not be easy if you have RI set up to use indices) rather than REINDEX.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform