]> git.saurik.com Git - wxWidgets.git/commitdiff
::bindInsertParams() was leaving some column bindings uninitialized if the column...
authorGeorge Tasker <gtasker@allenbrook.com>
Thu, 20 Jan 2000 15:21:27 +0000 (15:21 +0000)
committerGeorge Tasker <gtasker@allenbrook.com>
Thu, 20 Jan 2000 15:21:27 +0000 (15:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5551 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/dbtable.cpp

index 26898d56bb36a5369168f6329d1b5c133a2fb727..e25776555ca82001dc08d9e5ba8040fd24b0d49e 100644 (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));