>>>Hello,
>>>
>>>I'm using a grid with table buffering (either optimistic or pessimistic). When I change the primary key of one record or delete one record (my primary has filter to exclude deleted records) and then want to add a new record with the old key the system prompts "uniqueness of index violated" immediately when changing the row. The system seems to ignore the previous change in the buffer.
>>>
>>>Any suggestions?
>>>
>>>It works fine with record buffering.
>>>
>>>Thanks in advance.
>>>
>>>Andreas Stolz
>>
>>Issue a TABLEUPDATE(.f.) after changing the key and before moving the pointer, this will update the buffer and the index and allow you to use the old key on a new record.
>>
>>HTH
>Thanks. That's what I want to avoid, because with this solution I can't use tablerevert for this change.
>
>Andreas Stolz
The only other suggestion I have is to have a series of 'invalid' keys that are excluded in your index. If the same key needs to be used, copy the current record to a new one using an 'invalid' unique key. THEN change the current record using the old key, which never changed. After any of these, you'll be able to use TABLEREVERT()
Matt McDonnell
...building a better mousetrap with moldy cheese...