>Andrus, I ran the code and inserted
>
>WAIT WINDOW IIF(EOF("RCursor"), "At EOF", "Not at EOF")
>
>after the SET RELATION command and RCursor was at end-of-file prior to the UPDATE statement. So the 0 result looks correct as the !EOF() in the WHERE clause was false.
During VFP UPDATE command, related record pointers are moved also.
If you simply change the order of two INSERT statements, only the correct
record is updated.
The bug appears is that vfp sql optimizer takes eof() function as constant
expression and thus refuces to run UPDATE command.
If EOF() is initially .T., update command runs and updates correct records.
The same problem is with SQL SELECT statement.
use mytable in 0
select recno('mytable') from mytable
produces constant recno() values.
However, if mytable is not opened prior to select:
use in mytable
select recno('mytable') from mytable
recno() works correctly !
Does'nt this smell like another bug ?
Andrus