#endif
#ifdef DBDEBUG_CONSOLE
- #include <iostream.h>
+ #include "wx/ioswrap.h"
#endif
#ifdef __BORLANDC__
#include "wx/list.h"
#include "wx/utils.h"
#include "wx/msgdlg.h"
+ #include "wx/log.h"
#endif
#include "wx/filefn.h"
#endif
{
found = TRUE;
if (!TablesInUse.DeleteNode(pNode))
- wxMessageBox (s.GetData(),"Unable to delete node!");
+ wxLogDebug (s.c_str(),"Unable to delete node!");
}
else
pNode = pNode->Next();
{
wxString msg;
msg.sprintf("Unable to find the tableID in the linked\nlist of tables in use.\n\n%s",s.GetData());
- wxMessageBox (msg.GetData(),"NOTICE...");
+ wxLogDebug (msg.GetData(),"NOTICE...");
}
}
#endif
+
+
// Decrement the wxDB table count
if (pDb)
pDb->nTables--;
if (hstmtInsert)
if (SQLFreeStmt(hstmtInsert, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
+
if (hstmtDelete)
if (SQLFreeStmt(hstmtDelete, SQL_DROP) != SQL_SUCCESS)
- pDb->DispAllErrors(henv, hdbc);
+
if (hstmtUpdate)
if (SQLFreeStmt(hstmtUpdate, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
+
}
if (hstmtInternal)
if (SQLFreeStmt(hstmtInternal, SQL_DROP) != SQL_SUCCESS)
// Delete dynamically allocated cursors
if (hstmtDefault)
DeleteCursor(hstmtDefault);
+
if (hstmtCount)
DeleteCursor(hstmtCount);
+
} // wxTable::~wxTable()
return FALSE;
int i;
-// char sqlStmt[DB_MAX_STATEMENT_LEN];
wxString sqlStmt;
// Verify that the table exists in the database
{
// NOTE: This function returns TRUE if the Table does not exist, but
// only for identified databases. Code will need to be added
- // below for any other databases when those databases are defined
+ // below for any other databases when those databases are defined
// to handle this situation consistently
-// char sqlStmt[DB_MAX_STATEMENT_LEN];
wxString sqlStmt;
sqlStmt.sprintf("DROP TABLE %s", tableName);
// below for any other databases when those databases are defined
// to handle this situation consistently
-// char sqlStmt[DB_MAX_STATEMENT_LEN];
wxString sqlStmt;
if (pDb->Dbms() == dbmsACCESS)
pDb->WriteSqlLog(sqlStmt);
#ifdef DBDEBUG_CONSOLE
- cout << endl << sqlStmt.GetData() << endl << endl;
+ cout << endl << sqlStmt << endl << endl;
#endif
// Execute the SQL UPDATE statement
pDb->WriteSqlLog(sqlStmt);
#ifdef DBDEBUG_CONSOLE
- cout << endl << sqlStmt.GetData() << endl << endl;
+ cout << endl << sqlStmt << endl << endl;
#endif
// Execute the SQL UPDATE statement
pDt->second = 0;
pDt->fraction = 0;
break;
+
}
}
/********** wxTable::SetColDef() **********/
-// BJO20000121 : changed prototype in order to return proper pointer on wxColDataPtr's array
-//bool wxTable::SetColDefs(wxColInf *pColInfs, ULONG numCols, wxColDataPtr *pColDataPtrs)
wxColDataPtr* wxTable::SetColDefs (wxColInf *pColInfs, ULONG numCols)
{
assert(pColInfs);
for (index = 0; index < numCols; index++)
{
-/*
- wxString title,msg;
- title.sprintf("Catalog: %s, Schema: %s, Table name: %s",pColInfs[index].catalog,pColInfs[index].schema,pColInfs[index].tableName);
- msg.sprintf("Column name: %s\nData type: %04d\nType name: %s\nColumn size: %d\nBuffer len: %d\nDecimals:%d\nRadix: %d\nNullable: %d\nRemarks: %s",
- pColInfs[index].colName,pColInfs[index].sqlDataType,pColInfs[index].typeName,pColInfs[index].columnSize,pColInfs[index].bufferLength,pColInfs[index].decimalDigits,pColInfs[index].numPrecRadix,pColInfs[index].nullable,pColInfs[index].remarks);
- msg += " \nDB_DATA_TYPE: ";
- switch(pColInfs[index].dbDataType)
- {
- case DB_DATA_TYPE_VARCHAR:
- msg += pDb->typeInfVarchar.TypeName; break;
- case DB_DATA_TYPE_INTEGER:
- msg += pDb->typeInfInteger.TypeName; break;
- case DB_DATA_TYPE_FLOAT:
- msg += pDb->typeInfFloat.TypeName; break;
- case DB_DATA_TYPE_DATE:
- msg += pDb->typeInfDate.TypeName; break;
- }
- wxMessageBox(msg.GetData(),title.GetData());
-*/
// Process the fields
switch (pColInfs[index].dbDataType)
{
case DB_DATA_TYPE_VARCHAR:
{
- pColDataPtrs[index].PtrDataObj = new char[pColInfs[index].bufferLength+1];
- pColDataPtrs[index].SzDataObj = pColInfs[index].bufferLength;
- pColDataPtrs[index].SqlCtype = SQL_C_CHAR;
- break;
+ pColDataPtrs[index].PtrDataObj = new char[pColInfs[index].bufferLength+1];
+ pColDataPtrs[index].SzDataObj = pColInfs[index].columnSize;
+ pColDataPtrs[index].SqlCtype = SQL_C_CHAR;
+ break;
}
case DB_DATA_TYPE_INTEGER:
{
ULONG wxTable::Count(const char *args)
{
ULONG l;
-// char sqlStmt[DB_MAX_STATEMENT_LEN];
wxString sqlStmt;
SDWORD cb;