From: George Tasker Date: Thu, 20 Jan 2000 15:21:27 +0000 (+0000) Subject: ::bindInsertParams() was leaving some column bindings uninitialized if the column... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e15421ad3b12cbcbf4f1d5abfb153b00a7018bb8 ::bindInsertParams() was leaving some column bindings uninitialized if the column was set to insAllow=FALSE git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5551 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp index 26898d56bb..e25776555c 100644 --- a/src/common/dbtable.cpp +++ b/src/common/dbtable.cpp @@ -329,8 +329,8 @@ bool wxTable::bindInsertParams(void) SWORD scale = 0; // Bind each column (that can be inserted) of the table to a parameter marker - int i; - for (i = 0; i < noCols; i++) + int i,colNo; + for (i = 0, colNo = 1; i < noCols; i++) { if (! colDefs[i].InsertAllowed) continue; @@ -372,7 +372,7 @@ bool wxTable::bindInsertParams(void) colDefs[i].CbValue = SQL_NULL_DATA; colDefs[i].Null = FALSE; } - if (SQLBindParameter(hstmtInsert, i+1, SQL_PARAM_INPUT, colDefs[i].SqlCtype, + if (SQLBindParameter(hstmtInsert, colNo++, SQL_PARAM_INPUT, colDefs[i].SqlCtype, fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj, precision+1,&colDefs[i].CbValue) != SQL_SUCCESS) return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));