::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
This commit is contained in:
George Tasker 2000-01-20 15:21:27 +00:00
parent aeb040bfaf
commit e15421ad3b

View File

@ -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));