From 362a97bf562599ffed187628b075259be52be5c8 Mon Sep 17 00:00:00 2001 From: George Tasker Date: Tue, 28 Dec 2004 22:28:42 +0000 Subject: [PATCH] Added more support for using SQL_WVARCHAR and SQL_WCHAR data types git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31183 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/db.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/common/db.cpp b/src/common/db.cpp index 18184c49b8..35ff3bd145 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -287,14 +287,15 @@ int wxDbColFor::Format(int Nation, int dbDataType, SWORD sqlDataType, if (i_dbDataType == 0) // Filter unsupported dbDataTypes { - if ((i_sqlDataType == SQL_VARCHAR) || (i_sqlDataType == SQL_LONGVARCHAR)) + if ((i_sqlDataType == SQL_VARCHAR) || (i_sqlDataType == SQL_LONGVARCHAR) || + (i_sqlDataType == SQL_WCHAR) || (i_sqlDataType == SQL_WVARCHAR)) i_dbDataType = DB_DATA_TYPE_VARCHAR; if ((i_sqlDataType == SQL_C_DATE) || (i_sqlDataType == SQL_C_TIMESTAMP)) i_dbDataType = DB_DATA_TYPE_DATE; if (i_sqlDataType == SQL_C_BIT) i_dbDataType = DB_DATA_TYPE_INTEGER; if (i_sqlDataType == SQL_NUMERIC) - i_dbDataType = DB_DATA_TYPE_VARCHAR; + i_dbDataType = DB_DATA_TYPE_VARCHAR; // glt - ??? is this right? if (i_sqlDataType == SQL_REAL) i_dbDataType = DB_DATA_TYPE_FLOAT; if (i_sqlDataType == SQL_C_BINARY) @@ -2271,6 +2272,8 @@ bool wxDb::ExecSql(const wxString &pSqlStmt, wxDbColInf** columns, short& numcol switch (Sdword) { + case SQL_WCHAR: + case SQL_WVARCHAR: case SQL_VARCHAR: case SQL_CHAR: pColInf[colNum].dbDataType = DB_DATA_TYPE_VARCHAR; @@ -3046,6 +3049,8 @@ wxDbColInf *wxDb::GetColumns(const wxString &tableName, int *numCols, const wxCh // Get the intern datatype switch (colInf[colNo].sqlDataType) { + case SQL_WCHAR: + case SQL_WVARCHAR: case SQL_VARCHAR: case SQL_CHAR: colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR;