]> git.saurik.com Git - wxWidgets.git/commitdiff
use a different indicator when binding parameters and columns (patch 1718474)
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 24 May 2007 00:27:40 +0000 (00:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 24 May 2007 00:27:40 +0000 (00:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/dbtable.h
src/common/dbtable.cpp

index 06d695d8c34f692a26374bf7cbd45d371013708e..8d7de7322cbbd5e3ee139ff72fc4ebf7d3afb327 100644 (file)
@@ -55,8 +55,9 @@ public:
     bool    Updateable;                         // Specifies whether this column is updateable
     bool    InsertAllowed;                      // Specifies whether this column should be included in an INSERT statement
     bool    DerivedCol;                         // Specifies whether this column is a derived value
-    SQLLEN  CbValue;                            // Internal use only!!!
+    SQLLEN  CbValue;                            // Internal use only!!! For parameter bindings
     bool    Null;                               // NOT FULLY IMPLEMENTED - Allows NULL values in Inserts and Updates
+    SQLLEN  CbValueCol;                         // Internal use only!!! For column bindings
 
     wxDbColDef();
 
index e51af36535a198965b3ce1d7c5720c061ca78d24..6f867a1bdb6544537a2646085c7f6a5f00750ac7 100644 (file)
@@ -87,6 +87,7 @@ bool wxDbColDef::Initialize()
     DerivedCol      = false;
     CbValue         = 0;
     Null            = false;
+    CbValueCol      = 0;
 
     return true;
 }  // wxDbColDef::Initialize()
@@ -552,7 +553,7 @@ bool wxDbTable::bindCols(HSTMT cursor)
     for (i = 0; i < m_numCols; i++)
     {
         if (SQLBindCol(cursor, (UWORD)(i+1), colDefs[i].SqlCtype, (UCHAR*) colDefs[i].PtrDataObj,
-                       colDefs[i].SzDataObj, &colDefs[i].CbValue ) != SQL_SUCCESS)
+                       colDefs[i].SzDataObj, &colDefs[i].CbValueCol ) != SQL_SUCCESS)
           return (pDb->DispAllErrors(henv, hdbc, cursor));
     }
 
@@ -586,7 +587,7 @@ bool wxDbTable::getRec(UWORD fetchType)
             // of each column just read in.
             int i;
             for (i = 0; i < m_numCols; i++)
-                colDefs[i].Null = (colDefs[i].CbValue == SQL_NULL_DATA);
+                colDefs[i].Null = (colDefs[i].CbValueCol == SQL_NULL_DATA);
         }
     }
     else
@@ -606,7 +607,7 @@ bool wxDbTable::getRec(UWORD fetchType)
             // of each column just read in.
             int i;
             for (i = 0; i < m_numCols; i++)
-                colDefs[i].Null = (colDefs[i].CbValue == SQL_NULL_DATA);
+                colDefs[i].Null = (colDefs[i].CbValueCol == SQL_NULL_DATA);
         }
     }