Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP breaks ODBC specification, please confirm
Message
From
03/01/2006 21:36:17
 
 
To
18/12/2005 04:46:05
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01077772
Message ID:
01082975
Views:
13
Hello,


>ODBC application must call FreeStmt(SQL_CLOSE) and
>FreeStmt(SQL_RESET_PARAMS). But VFP doesn't call it.


the ODBC spec is unclear if SQLCancel frees any statement data like bound parameters or columns.

since there is a special function to do this, I think it's the responsibility of the ODBC client (VFP in this case) to make sure that a statement is in the correct state. Since VFP caches a common statement handle that it reuses, it has to call SQLFreeStmt(SQL_UNBIND) and SQLFreeStmt(SQL_RESET_PARAMS) to make sure the cached statement handle is in a cleared state before reusing it. VFP indeed calls these functions when all goes well, but when an error occurs in SQLExecuteDirect it just calls SQLCancel and then returns from SQLEXEC.


http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2.doc.odbc/bjnemstr62.htm

"Unbinding parameter markers: All parameters that SQLBindParameter() binds remain bound until you perform one of the following actions:
* Call SQLFreeHandle() with the HandleType argument set to SQL_HANDLE_STMT.
* Call SQLFreeStmt() with the fOption argument set to SQL_RESET_PARAMS.
* Call SQLBindParameter() again for the same parameter ipar number.
"

SQLCancel is not mentioned there either to have any affect on bound parameteres/columns.

a similar issue
http://groups.google.de/group/microsoft.public.data.odbc/browse_frm/thread/1a350eeaf5ab6557/6d68a7f34bad91cc?lnk=st&q=SQLCancel+access&rnum=23&hl=de#6d68a7f34bad91cc

SQLCancel is not meant to reset all data that is related to a statement handle. SQLFreeStmt does this.

here
http://groups.google.de/group/microsoft.public.sqlserver.odbc/browse_frm/thread/76b17b058351a675/94c3e7f0d53dc373?lnk=st&q=SQLCancel+access&rnum=29&hl=de#94c3e7f0d53dc373

the right calls are issued to reuse a cached statement handle!

At least for me this is a bug in VFP, which is caused by the fact that it caches a common statement handle but doesn't reset it correcly when an error occurs.

Regards
Christian
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform