wxString s;
tableID = ++lastTableID;
- s.Printf(wxT("wxDbTable constructor (%-20s) tableID:[%6lu] pDb:[%p]"), tblName,tableID,pDb);
+ s.Printf(wxT("wxDbTable constructor (%-20s) tableID:[%6lu] pDb:[%p]"), tblName.c_str(), tableID, pDb);
#ifdef __WXDEBUG__
wxTablesInUse *tableInUse;
wxString s;
if (pDb)
{
- s.Printf(wxT("wxDbTable destructor (%-20s) tableID:[%6lu] pDb:[%p]"), tableName,tableID,pDb);
+ s.Printf(wxT("wxDbTable destructor (%-20s) tableID:[%6lu] pDb:[%p]"), tableName.c_str(), tableID, pDb);
pDb->WriteSqlLog(s);
}
if (!queryOnly)
{
if (hstmtInsert)
+ {
+/*
+ODBC 3.0 says to use this form
+ if (SQLFreeHandle(*hstmtDel, SQL_DROP) != SQL_SUCCESS)
+*/
if (SQLFreeStmt(hstmtInsert, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
+ }
if (hstmtDelete)
+ {
+/*
+ODBC 3.0 says to use this form
+ if (SQLFreeHandle(*hstmtDel, SQL_DROP) != SQL_SUCCESS)
+*/
if (SQLFreeStmt(hstmtDelete, SQL_DROP) != SQL_SUCCESS)
+ pDb->DispAllErrors(henv, hdbc);
+ }
if (hstmtUpdate)
+ {
+/*
+ODBC 3.0 says to use this form
+ if (SQLFreeHandle(*hstmtDel, SQL_DROP) != SQL_SUCCESS)
+*/
if (SQLFreeStmt(hstmtUpdate, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
+ }
}
if (hstmtInternal)
+ {
if (SQLFreeStmt(hstmtInternal, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
+ }
// Delete dynamically allocated cursors
if (hstmtDefault)
wxString p;
if (!tablePath.IsEmpty())
- p.Printf(wxT("Error opening '%s/%s'.\n"),tablePath,tableName);
+ p.Printf(wxT("Error opening '%s/%s'.\n"),tablePath.c_str(),tableName.c_str());
else
- p.Printf(wxT("Error opening '%s'.\n"), tableName);
+ p.Printf(wxT("Error opening '%s'.\n"), tableName.c_str());
p += s;
pDb->LogError(p.GetData());
if (!queryOnly && noCols > 0)
{
bool needComma = FALSE;
- sqlStmt.Printf(wxT("INSERT INTO %s ("), tableName);
+ sqlStmt.Printf(wxT("INSERT INTO %s ("), tableName.c_str());
for (i = 0; i < noCols; i++)
{
if (! colDefs[i].InsertAllowed)
// delete all records from the database in this case.
if (typeOfDel == DB_DEL_WHERE && (pWhereClause.Length() == 0))
{
- pSqlStmt.Printf(wxT("DELETE FROM %s"), tableName);
+ pSqlStmt.Printf(wxT("DELETE FROM %s"), tableName.c_str());
return;
}
- pSqlStmt.Printf(wxT("DELETE FROM %s WHERE "), tableName);
+ pSqlStmt.Printf(wxT("DELETE FROM %s WHERE "), tableName.c_str());
// Append the WHERE clause to the SQL DELETE statement
switch(typeOfDel)
bool firstColumn = TRUE;
- pSqlStmt.Printf(wxT("UPDATE %s SET "), tableName);
+ pSqlStmt.Printf(wxT("UPDATE %s SET "), tableName.c_str());
// Append a list of columns to be updated
int i;
// Build a CREATE TABLE string from the colDefs structure.
bool needComma = FALSE;
- sqlStmt.Printf(wxT("CREATE TABLE %s ("), tableName);
+ sqlStmt.Printf(wxT("CREATE TABLE %s ("), tableName.c_str());
for (i = 0; i < noCols; i++)
{
wxString sqlStmt;
- sqlStmt.Printf(wxT("DROP TABLE %s"), tableName);
+ sqlStmt.Printf(wxT("DROP TABLE %s"), tableName.c_str());
pDb->WriteSqlLog(sqlStmt);
wxString sqlStmt;
if (pDb->Dbms() == dbmsACCESS || pDb->Dbms() == dbmsMY_SQL)
- sqlStmt.Printf(wxT("DROP INDEX %s ON %s"),idxName,tableName);
+ sqlStmt.Printf(wxT("DROP INDEX %s ON %s"),idxName.c_str(), tableName.c_str());
else if ((pDb->Dbms() == dbmsMS_SQL_SERVER) ||
(pDb->Dbms() == dbmsSYBASE_ASE))
- sqlStmt.Printf(wxT("DROP INDEX %s.%s"),tableName,idxName);
+ sqlStmt.Printf(wxT("DROP INDEX %s.%s"),tableName.c_str(), idxName.c_str());
else
- sqlStmt.Printf(wxT("DROP INDEX %s"),idxName);
+ sqlStmt.Printf(wxT("DROP INDEX %s"),idxName.c_str());
pDb->WriteSqlLog(sqlStmt);
if (!hstmtDel) // Cursor already deleted
return(result);
+/*
+ODBC 3.0 says to use this form
+ if (SQLFreeHandle(*hstmtDel, SQL_DROP) != SQL_SUCCESS)
+
+*/
if (SQLFreeStmt(*hstmtDel, SQL_DROP) != SQL_SUCCESS)
{
pDb->DispAllErrors(henv, hdbc);