Replaced wxMessageBox() with wxLogDebug() calls
When calling GetColumns(), some drivers/datasources would not return a proper value for columnSize. If columnSize is less than 1, columnSize gets set to bufferLength
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6293
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#endif
#ifdef DBDEBUG_CONSOLE
#endif
#ifdef DBDEBUG_CONSOLE
+ #include "wx/ioswrap.h"
#endif
#ifdef __BORLANDC__
#endif
#ifdef __BORLANDC__
{
s.sprintf("(%-20s) tableID:[%6lu] pDb:[%p]", tiu->tableName,tiu->tableID,tiu->pDb);
s2.sprintf("Orphaned found using pDb:[%p]",this);
{
s.sprintf("(%-20s) tableID:[%6lu] pDb:[%p]", tiu->tableName,tiu->tableID,tiu->pDb);
s2.sprintf("Orphaned found using pDb:[%p]",this);
}
pNode = pNode->Next();
}
}
pNode = pNode->Next();
}
- wxMessageBox(odbcErrMsg.GetData(),"DEBUG MESSAGE from DispAllErrors()");
+ wxLogDebug(odbcErrMsg.GetData(),"DEBUG MESSAGE from DispAllErrors()");
GetData( 9, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].decimalDigits,0, &cb);
GetData(10, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].numPrecRadix, 0, &cb);
GetData(11, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].nullable, 0, &cb);
GetData( 9, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].decimalDigits,0, &cb);
GetData(10, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].numPrecRadix, 0, &cb);
GetData(11, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].nullable, 0, &cb);
- GetData(12, SQL_C_CHAR, (UCHAR*) colInf[colNo].remarks, 254+1, &cb);
+ GetData(12, SQL_C_CHAR, (UCHAR*) colInf[colNo].remarks, 254+1, &cb);
// Determine the wxDB data type that is used to represent the native data type of this data source
colInf[colNo].dbDataType = 0;
if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
// Determine the wxDB data type that is used to represent the native data type of this data source
colInf[colNo].dbDataType = 0;
if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
+ {
+ if (colInf[colNo].columnSize < 1)
+ {
+ // Apparently mySQL and Postgres (or their ODBC drivers) do not
+ // return a columnSize, so set columnSize = bufferLength
+ // if no column size was returned
+ colInf[colNo].columnSize = colInf[colNo].bufferLength;
+ }
colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;
colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;
else if (!wxStricmp(typeInfInteger.TypeName,colInf[colNo].typeName))
colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;
else if (!wxStricmp(typeInfFloat.TypeName,colInf[colNo].typeName))
else if (!wxStricmp(typeInfInteger.TypeName,colInf[colNo].typeName))
colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;
else if (!wxStricmp(typeInfFloat.TypeName,colInf[colNo].typeName))
// Determine the wxDB data type that is used to represent the native data type of this data source
colInf[colNo].dbDataType = 0;
if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
// Determine the wxDB data type that is used to represent the native data type of this data source
colInf[colNo].dbDataType = 0;
if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName))
+ {
+ if (colInf[colNo].columnSize < 1)
+ {
+ // Apparently mySQL and Postgres (or their ODBC drivers) do not
+ // return a columnSize, so set columnSize = bufferLength
+ // if no column size was returned
+ colInf[colNo].columnSize = colInf[colNo].bufferLength;
+ }
colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;
colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;
else if (!wxStricmp(typeInfInteger.TypeName,colInf[colNo].typeName))
colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;
else if (!wxStricmp(typeInfFloat.TypeName,colInf[colNo].typeName))
else if (!wxStricmp(typeInfInteger.TypeName,colInf[colNo].typeName))
colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER;
else if (!wxStricmp(typeInfFloat.TypeName,colInf[colNo].typeName))