Favio-
> the problem is that I don’t know how to validate that a record is not duplicated, because the record is already created when I try to validate the key. ( I guess for buffering )
I suggest the following as a possible option:
1. Use surrogate (not natural) candidate keys.
2. Use buffering to insert the record without committing it.
use myFreeTable
set multilocks on
cursorsetprop('buffering',5)
3. Generate the candidate key in code so you're always assured of uniqueness.
insert into myFreeTable (someIDfield) values (FunctionToGetID())
FunctionToGetID
would return a valid primary key.
4. When you update your changes, check the return value, and if it was unsuccessful (
TABLEUPDATE( 2 ) returns .F.
), make the necessary correction.
5. If you can, read Effective Techniques for Application Development in Visual FoxPro 6.0 available through
www.hentzenwerke.com