From: George Tasker Date: Wed, 12 May 2004 14:22:25 +0000 (+0000) Subject: Use of blobs with a binding to a SQL_C_BINARY type column definition was not working... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/76ea1664980282b58c01a5c3a833839a6c0d1bf9?ds=inline Use of blobs with a binding to a SQL_C_BINARY type column definition was not working correctly. The code should now work for SQL_C_BINARY and SQL_C_CHAR column bindings, though I have only tested with SQL_C_BINARY. The original code will be used if the column binding is not SQL_C_BINARY or SQL_C_CHAR git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp index c5482f8a69..bf070f954e 100644 --- a/src/common/dbtable.cpp +++ b/src/common/dbtable.cpp @@ -489,6 +489,11 @@ bool wxDbTable::bindParams(bool forUpdate) if (colDefs[i].Null) colDefs[i].CbValue = SQL_NULL_DATA; else + if (colDefs[i].SqlCtype == SQL_C_BINARY) + colDefs[i].CbValue = 0; + else if (colDefs[i].SqlCtype == SQL_C_CHAR) + colDefs[i].CbValue = SQL_LEN_DATA_AT_EXEC(0); + else colDefs[i].CbValue = SQL_LEN_DATA_AT_EXEC(colDefs[i].SzDataObj); break; }