X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/06322acab7b6253ea3e8a0d5c82bc4c45f210157..72366f68d1036084d1adc5971eeee4885f36fe5c:/src/common/dbtable.cpp diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp index 5463713419..4d8f113e6c 100644 --- a/src/common/dbtable.cpp +++ b/src/common/dbtable.cpp @@ -560,21 +560,17 @@ bool wxDbTable::bindUpdateParams(void) /********** wxDbTable::bindCols() **********/ bool wxDbTable::bindCols(HSTMT cursor) { - static SQLLEN cb; - // Bind each column of the table to a memory address for fetching data UWORD i; for (i = 0; i < m_numCols; i++) { - cb = colDefs[i].CbValue; if (SQLBindCol(cursor, (UWORD)(i+1), colDefs[i].SqlCtype, (UCHAR*) colDefs[i].PtrDataObj, - colDefs[i].SzDataObj, &cb ) != SQL_SUCCESS) + colDefs[i].SzDataObj, &colDefs[i].CbValue ) != SQL_SUCCESS) return (pDb->DispAllErrors(henv, hdbc, cursor)); } // Completed successfully return true; - } // wxDbTable::bindCols() @@ -1312,7 +1308,7 @@ void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere, case SQL_C_WCHAR: #endif //case SQL_C_WXCHAR: SQL_C_WXCHAR is covered by either SQL_C_CHAR or SQL_C_WCHAR - colValue.Printf(wxT("'%s'"), (UCHAR FAR *) colDefs[colNumber].PtrDataObj); + colValue.Printf(wxT("'%s'"), GetDb()->EscapeSqlChars((wxChar *)colDefs[colNumber].PtrDataObj).c_str()); break; case SQL_C_SHORT: case SQL_C_SSHORT: