+void wxDbTable::setCbValueForColumn(int columnIndex)
+{
+ switch(colDefs[columnIndex].DbDataType)
+ {
+ case DB_DATA_TYPE_VARCHAR:
+ if (colDefs[columnIndex].Null)
+ colDefs[columnIndex].CbValue = SQL_NULL_DATA;
+ else
+ colDefs[columnIndex].CbValue = SQL_NTS;
+ break;
+ case DB_DATA_TYPE_INTEGER:
+ if (colDefs[columnIndex].Null)
+ colDefs[columnIndex].CbValue = SQL_NULL_DATA;
+ else
+ colDefs[columnIndex].CbValue = 0;
+ break;
+ case DB_DATA_TYPE_FLOAT:
+ if (colDefs[columnIndex].Null)
+ colDefs[columnIndex].CbValue = SQL_NULL_DATA;
+ else
+ colDefs[columnIndex].CbValue = 0;
+ break;
+ case DB_DATA_TYPE_DATE:
+ if (colDefs[columnIndex].Null)
+ colDefs[columnIndex].CbValue = SQL_NULL_DATA;
+ else
+ colDefs[columnIndex].CbValue = 0;
+ break;
+ case DB_DATA_TYPE_BLOB:
+ if (colDefs[columnIndex].Null)
+ colDefs[columnIndex].CbValue = SQL_NULL_DATA;
+ else
+ if (colDefs[columnIndex].SqlCtype == SQL_C_CHAR)
+ colDefs[columnIndex].CbValue = SQL_NTS;
+ else
+ colDefs[columnIndex].CbValue = SQL_LEN_DATA_AT_EXEC(colDefs[columnIndex].SzDataObj);
+ break;
+ }
+}
+