From: George Tasker Date: Thu, 13 May 2004 01:56:18 +0000 (+0000) Subject: More BLOB fixes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c9b6d7964db3e5bdbf81f1469bf757c8f912ac75 More BLOB fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27249 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp index 9e71e79480..03cedf85f3 100644 --- a/src/common/dbtable.cpp +++ b/src/common/dbtable.cpp @@ -442,9 +442,7 @@ void wxDbTable::setCbValueForColumn(int columnIndex) if (colDefs[columnIndex].Null) colDefs[columnIndex].CbValue = SQL_NULL_DATA; else - if (colDefs[columnIndex].SqlCtype == SQL_C_BINARY) - colDefs[columnIndex].CbValue = 0; - else if (colDefs[columnIndex].SqlCtype == SQL_C_CHAR) + if (colDefs[columnIndex].SqlCtype == SQL_C_CHAR) colDefs[columnIndex].CbValue = SQL_LEN_DATA_AT_EXEC(0); else colDefs[columnIndex].CbValue = SQL_LEN_DATA_AT_EXEC(colDefs[columnIndex].SzDataObj); @@ -510,7 +508,7 @@ bool wxDbTable::bindParams(bool forUpdate) break; case DB_DATA_TYPE_BLOB: fSqlType = pDb->GetTypeInfBlob().FsqlType; - precision = -1; + precision = colDefs[i].SzDataObj; scale = 0; break; } @@ -530,7 +528,7 @@ bool wxDbTable::bindParams(bool forUpdate) { if (SQLBindParameter(hstmtInsert, colNo++, SQL_PARAM_INPUT, colDefs[i].SqlCtype, fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj, - precision+1,&colDefs[i].CbValue) != SQL_SUCCESS) + precision+1, &colDefs[i].CbValue) != SQL_SUCCESS) { return(pDb->DispAllErrors(henv, hdbc, hstmtInsert)); } @@ -692,6 +690,7 @@ bool wxDbTable::execUpdate(const wxString &pSqlStmt) break; } } + retcode = SQLParamData(hstmtUpdate, &pParmID); } if (retcode == SQL_SUCCESS || retcode == SQL_NO_DATA_FOUND || @@ -867,7 +866,7 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) return(pDb->DispAllErrors(henv, hdbc, hstmtInsert)); } else - insertable= FALSE; + insertable = FALSE; } // Completed successfully @@ -1946,6 +1945,7 @@ int wxDbTable::Insert(void) break; } } + retcode = SQLParamData(hstmtInsert, &pParmID); } }