]> git.saurik.com Git - wxWidgets.git/commitdiff
Added more support for using SQL_WVARCHAR and SQL_WCHAR data types
authorGeorge Tasker <gtasker@allenbrook.com>
Tue, 28 Dec 2004 22:28:42 +0000 (22:28 +0000)
committerGeorge Tasker <gtasker@allenbrook.com>
Tue, 28 Dec 2004 22:28:42 +0000 (22:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31183 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/db.cpp

index 18184c49b850238b0fa07a68d86f1f7103d78a71..35ff3bd14595facb05ab1315b46fc85cd1a65dbf 100644 (file)
@@ -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;