>Platform: Visual FoxPro 09.00.0000.3504 for Windows [Nov 4 2005 17:39:44]
>Server: PostgreSQL ODBC driver ver. 104
>
>I created repro where VFP application crashes using PostgreSQL ODBC driver.
>
>PostgreSQL ODBC driver developer wrote that VFP breaks ODBC specification and refuses to fix this in ODBC driver release code.
>
>ODBC specification:
>
>| After SQLExecute or SQLExecDirect returns SQL_NEED_DATA and before
>| data has been sent for all data-at-execution parameters,
>| an application can call SQLCancel to cancel the statement execution.
>| After the statement has been canceled, the application can call
>| SQLExecute or SQLExecDirect again.
>
>Bind parameters can't be destroyed in SQLCancel.
Why ?
>
>ODBC application must call FreeStmt(SQL_CLOSE) and
>FreeStmt(SQL_RESET_PARAMS). But VFP doesn't call it.
Why ? Where is written this into the odbc spec. ?
The ODBC driver have to do these operations implicitly.
It is responsibility of the driver ODBC to maintain his coherent inside state.
If I write an application that sends casual commands to the driver,
it never owes collapse.
>This causes VFP application to crash sometimes in a SQLEXEC() call followed by error returned from server.
>
The crash is caused by the driver ODBC that it remains in a not defined state,
and the next SQLEXEC() destroy the ODBC state machine.
>Link bug tracker:
>
>
http://pgfoundry.org/tracker/index.php?func=detail&aid=1000481&group_id=1000125&atid=538>
>Discussion:
>
>
http://archives.postgresql.org/pgsql-odbc/2005-12/msg00144.php>
>Any idea how to fix this ?
Write a correct ODBC driver.