>Hi Andrus,
>
>> Unfortunately, if backend returns error as response to SQLEXEC(), VFP automatically sends ROLLBACK command to backend!
>
>How have you determined that VFP sends a ROLLBACK command? I'm asking, because I haven't seen this behavior yet, and I too, have code that first fails, picks an alternative and completes successfully.
I turned logging ON in a PostgreSQL ODBC driver.
In this case, all sql commands and their results are written to a log file.
This log shows that after error, an extra ROLLBACK command is always sent to
to Postgres.
This ROLLBACK command is not generated by my application.
Also, when I try to read the data added in this transaction, the data does not exist. So real rollback is done in backend.
>Are you, by chance, disconnecting from the server? In this case, the following line might help:
>
>SQLSetProp( This.nHandle, "DisconnectRollback", .F. )
>
I'm testing this in a developemnt computer connected to localhost.
It is simple to create a code to reproduce this. This is always reproducible.
Andrus