]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dbtable.cpp
message output for darwin into console, cannot use the normal converters as these...
[wxWidgets.git] / src / common / dbtable.cpp
index 9e71e7948000d0ae4a854343b66158f9c5788075..56a496d843e0675b85ea35d1c888101197dd68b6 100644 (file)
 // Notice:      This class library and its intellectual design are free of charge for use,
 //              modification, enhancement, debugging under the following conditions:
 //              1) These classes may only be used as part of the implementation of a
 // Notice:      This class library and its intellectual design are free of charge for use,
 //              modification, enhancement, debugging under the following conditions:
 //              1) These classes may only be used as part of the implementation of a
-//                 wxWindows-based application
-//              2) All enhancements and bug fixes are to be submitted back to the wxWindows
-//                 user groups free of all charges for use with the wxWindows library.
+//                 wxWidgets-based application
+//              2) All enhancements and bug fixes are to be submitted back to the wxWidgets
+//                 user groups free of all charges for use with the wxWidgets library.
 //              3) These classes may not be distributed as part of any other class library,
 //                 DLL, text (written or electronic), other than a complete distribution of
 //              3) These classes may not be distributed as part of any other class library,
 //                 DLL, text (written or electronic), other than a complete distribution of
-//                 the wxWindows GUI development toolkit.
+//                 the wxWidgets GUI development toolkit.
 ///////////////////////////////////////////////////////////////////////////////
 
 /*
 ///////////////////////////////////////////////////////////////////////////////
 
 /*
@@ -442,10 +442,8 @@ void wxDbTable::setCbValueForColumn(int columnIndex)
             if (colDefs[columnIndex].Null)
                 colDefs[columnIndex].CbValue = SQL_NULL_DATA;
             else
             if (colDefs[columnIndex].Null)
                 colDefs[columnIndex].CbValue = SQL_NULL_DATA;
             else
-                if (colDefs[columnIndex].SqlCtype == SQL_C_BINARY)
-                    colDefs[columnIndex].CbValue = 0;
-                else if (colDefs[columnIndex].SqlCtype == SQL_C_CHAR)
-                    colDefs[columnIndex].CbValue = SQL_LEN_DATA_AT_EXEC(0);
+                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;
                 else
                     colDefs[columnIndex].CbValue = SQL_LEN_DATA_AT_EXEC(colDefs[columnIndex].SzDataObj);
             break;
@@ -510,7 +508,7 @@ bool wxDbTable::bindParams(bool forUpdate)
                 break;
             case DB_DATA_TYPE_BLOB:
                 fSqlType = pDb->GetTypeInfBlob().FsqlType;
                 break;
             case DB_DATA_TYPE_BLOB:
                 fSqlType = pDb->GetTypeInfBlob().FsqlType;
-                precision = -1;
+                precision = colDefs[i].SzDataObj;
                 scale = 0;
                 break;
         }
                 scale = 0;
                 break;
         }
@@ -530,7 +528,7 @@ bool wxDbTable::bindParams(bool forUpdate)
         {
             if (SQLBindParameter(hstmtInsert, colNo++, SQL_PARAM_INPUT, colDefs[i].SqlCtype,
                                  fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj,
         {
             if (SQLBindParameter(hstmtInsert, colNo++, SQL_PARAM_INPUT, colDefs[i].SqlCtype,
                                  fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj,
-                                 precision+1,&colDefs[i].CbValue) != SQL_SUCCESS)
+                                 precision+1, &colDefs[i].CbValue) != SQL_SUCCESS)
             {
                 return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
             }
             {
                 return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
             }
@@ -692,6 +690,7 @@ bool wxDbTable::execUpdate(const wxString &pSqlStmt)
                     break;
                 }
             }
                     break;
                 }
             }
+            retcode = SQLParamData(hstmtUpdate, &pParmID);
         }
         if (retcode == SQL_SUCCESS ||
             retcode == SQL_NO_DATA_FOUND ||
         }
         if (retcode == SQL_SUCCESS ||
             retcode == SQL_NO_DATA_FOUND ||
@@ -867,7 +866,7 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists)
                 return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
         }
         else
                 return(pDb->DispAllErrors(henv, hdbc, hstmtInsert));
         }
         else
-            insertable= FALSE;
+            insertable = FALSE;
     }
 
     // Completed successfully
     }
 
     // Completed successfully
@@ -1327,7 +1326,7 @@ void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere,
                         wxString strMsg;
                         strMsg.Printf(wxT("wxDbTable::bindParams(): Unknown column type for colDefs %d colName %s"),
                                     colNo,colDefs[colNo].ColName);
                         wxString strMsg;
                         strMsg.Printf(wxT("wxDbTable::bindParams(): Unknown column type for colDefs %d colName %s"),
                                     colNo,colDefs[colNo].ColName);
-                        wxFAIL_MSG(wxT(strMsg));
+                        wxFAIL_MSG(strMsg.c_str());
                     }
                     break;
             }
                     }
                     break;
             }
@@ -1946,6 +1945,7 @@ int wxDbTable::Insert(void)
                     break;
                 }
             }
                     break;
                 }
             }
+            retcode = SQLParamData(hstmtInsert, &pParmID);
         }
     }
 
         }
     }