General gcc changes in the Printf() statement when using wxStrings as params to Printf()
General code clean up, correcting comments, added more comments tagging where changes for ODBC 3.0 support needs to be added
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9274
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxString s;
tableID = ++lastTableID;
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;
#ifdef __WXDEBUG__
wxTablesInUse *tableInUse;
- 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);
if (!queryOnly)
{
if (hstmtInsert)
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 (SQLFreeStmt(hstmtInsert, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
+ {
+/*
+ODBC 3.0 says to use this form
+ if (SQLFreeHandle(*hstmtDel, SQL_DROP) != SQL_SUCCESS)
+*/
if (SQLFreeStmt(hstmtDelete, SQL_DROP) != SQL_SUCCESS)
if (SQLFreeStmt(hstmtDelete, SQL_DROP) != SQL_SUCCESS)
+ pDb->DispAllErrors(henv, hdbc);
+ }
+ {
+/*
+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 (SQLFreeStmt(hstmtUpdate, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
if (SQLFreeStmt(hstmtInternal, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
if (SQLFreeStmt(hstmtInternal, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
// Delete dynamically allocated cursors
if (hstmtDefault)
// Delete dynamically allocated cursors
if (hstmtDefault)
wxString p;
if (!tablePath.IsEmpty())
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());
- p.Printf(wxT("Error opening '%s'.\n"), tableName);
+ p.Printf(wxT("Error opening '%s'.\n"), tableName.c_str());
p += s;
pDb->LogError(p.GetData());
p += s;
pDb->LogError(p.GetData());
if (!queryOnly && noCols > 0)
{
bool needComma = FALSE;
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)
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))
{
// 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());
- 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)
// Append the WHERE clause to the SQL DELETE statement
switch(typeOfDel)
- 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;
// Append a list of columns to be updated
int i;
// Build a CREATE TABLE string from the colDefs structure.
bool needComma = FALSE;
// 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++)
{
for (i = 0; i < noCols; i++)
{
- sqlStmt.Printf(wxT("DROP TABLE %s"), tableName);
+ sqlStmt.Printf(wxT("DROP TABLE %s"), tableName.c_str());
pDb->WriteSqlLog(sqlStmt);
pDb->WriteSqlLog(sqlStmt);
wxString sqlStmt;
if (pDb->Dbms() == dbmsACCESS || pDb->Dbms() == dbmsMY_SQL)
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))
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());
- sqlStmt.Printf(wxT("DROP INDEX %s"),idxName);
+ sqlStmt.Printf(wxT("DROP INDEX %s"),idxName.c_str());
pDb->WriteSqlLog(sqlStmt);
pDb->WriteSqlLog(sqlStmt);
if (!hstmtDel) // Cursor already deleted
return(result);
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);
if (SQLFreeStmt(*hstmtDel, SQL_DROP) != SQL_SUCCESS)
{
pDb->DispAllErrors(henv, hdbc);