X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/67e9aaa3c9cafcba85c06187a9c38896733f403c..8727a1fe6f530b33829384c052484238c5e06e54:/src/common/dbtable.cpp 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));