]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dbtable.cpp
use ES_RIGHT|ES_NUMBER styles for the buddy control as it's used for numeric entry...
[wxWidgets.git] / src / common / dbtable.cpp
index 87a90e01a04275e05f1981a0da9f21e1087bd3aa..ac9981425e04ce32a4ce0a5abb091628d593f85b 100644 (file)
@@ -25,6 +25,7 @@
     #include "wx/string.h"
     #include "wx/utils.h"
     #include "wx/log.h"
+    #include "wx/crt.h"
 #endif
 
 #ifdef DBDEBUG_CONSOLE
@@ -87,6 +88,7 @@ bool wxDbColDef::Initialize()
     DerivedCol      = false;
     CbValue         = 0;
     Null            = false;
+    CbValueCol      = 0;
 
     return true;
 }  // wxDbColDef::Initialize()
@@ -552,7 +554,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 +588,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 +608,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);
         }
     }
 
@@ -1517,7 +1519,7 @@ bool wxDbTable::CreateTable(bool attemptDrop)
                 //  DB2 is limited to 18 characters for index names
                 if (pDb->Dbms() == dbmsDB2)
                 {
-                    wxASSERT_MSG((tableName && wxStrlen(tableName) <= 13), wxT("DB2 table/index names must be no longer than 13 characters in length.\n\nTruncating table name to 13 characters."));
+                    wxASSERT_MSG(!tableName.empty() && tableName.length() <= 13, wxT("DB2 table/index names must be no longer than 13 characters in length.\n\nTruncating table name to 13 characters."));
                     sqlStmt += pDb->SQLTableName(tableName.substr(0, 13).c_str());
 //                    sqlStmt += tableName.substr(0, 13);
                 }