From: George Tasker Date: Fri, 5 Jul 2002 14:41:09 +0000 (+0000) Subject: Fixes the problem with VARCHAR fields not allowing the stored string to ever be lengt... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9d9436810d06cc997f59ace9397af8d1868d4257 Fixes the problem with VARCHAR fields not allowing the stored string to ever be lengthened beyond the original stored length of the field. NOTE: There may be a problem with NULLs now, so this needs further testing. I'm not sure if this affects NULL column handling git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp index e11ff65602..49e2c2348d 100644 --- a/src/common/dbtable.cpp +++ b/src/common/dbtable.cpp @@ -528,15 +528,16 @@ bool wxDbTable::bindUpdateParams(void) /********** wxDbTable::bindCols() **********/ bool wxDbTable::bindCols(HSTMT cursor) { + static SDWORD cb; + // Bind each column of the table to a memory address for fetching data UWORD i; for (i = 0; i < noCols; i++) { + cb = colDefs[i].CbValue; if (SQLBindCol(cursor, (UWORD)(i+1), colDefs[i].SqlCtype, (UCHAR*) colDefs[i].PtrDataObj, - colDefs[i].SzDataObj, &colDefs[i].CbValue ) != SQL_SUCCESS) - { + colDefs[i].SzDataObj, &cb ) != SQL_SUCCESS) return (pDb->DispAllErrors(henv, hdbc, cursor)); - } } // Completed successfully