]> git.saurik.com Git - wxWidgets.git/commitdiff
Unicode compilation fixes
authorGeorge Tasker <gtasker@allenbrook.com>
Tue, 18 May 2004 01:55:15 +0000 (01:55 +0000)
committerGeorge Tasker <gtasker@allenbrook.com>
Tue, 18 May 2004 01:55:15 +0000 (01:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27328 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/db.cpp
src/common/dbtable.cpp

index 6f07ddc6359eb542145820b72caf332454a7f22f..86b235af2fa59daef383ae85a782c77888f22fdf 100644 (file)
@@ -753,9 +753,9 @@ bool wxDb::open(bool failOnDataTypeUnsupported)
 bool wxDb::Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported)
 {
     wxASSERT(inConnectStr.Length());
-    dsn        = "";
-    uid        = "";
-    authStr    = "";
+    dsn        = wxT("");
+    uid        = wxT("");
+    authStr    = wxT("");
 
     RETCODE retcode;
 
@@ -770,17 +770,19 @@ bool wxDb::Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported)
             cout << wxT("SQLSetConnectOption(CURSOR_LIB) successful") << endl;
         else
             cout << wxT("SQLSetConnectOption(CURSOR_LIB) failed") << endl;
+#else
+        wxUnusedVar(retcode);
 #endif
     }
 
     // Connect to the data source
-    UCHAR outConnectBuffer[SQL_MAX_CONNECTSTR_LEN+1];  // MS recommends at least 1k buffer
+    SQLTCHAR outConnectBuffer[SQL_MAX_CONNECTSTR_LEN+1];  // MS recommends at least 1k buffer
     short outConnectBufferLen;
 
     inConnectionStr = inConnectStr;
 
-    retcode = SQLDriverConnect(hdbc, NULL, (UCHAR FAR *)inConnectionStr.c_str(),
-                        inConnectionStr.Length(), (UCHAR FAR *)outConnectBuffer,
+    retcode = SQLDriverConnect(hdbc, NULL, (SQLTCHAR FAR *)inConnectionStr.c_str(),
+                        inConnectionStr.Length(), (SQLTCHAR FAR *)outConnectBuffer,
                         sizeof(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE );
 
     if ((retcode != SQL_SUCCESS) &&
@@ -802,8 +804,8 @@ bool wxDb::Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthSt
     uid        = Uid;
     authStr    = AuthStr;
 
-    inConnectionStr = "";
-    outConnectionStr = "";
+    inConnectionStr = wxT("");
+    outConnectionStr = wxT("");
 
     RETCODE retcode;
 
@@ -879,13 +881,13 @@ bool wxDb::Open(wxDb *copyDb)
     if (copyDb->OpenedWithConnectionString())
     {
         // Connect to the data source
-        UCHAR outConnectBuffer[SQL_MAX_CONNECTSTR_LEN+1];
+        SQLTCHAR outConnectBuffer[SQL_MAX_CONNECTSTR_LEN+1];
         short outConnectBufferLen;
 
         inConnectionStr = copyDb->GetConnectionInStr();
 
-        retcode = SQLDriverConnect(hdbc, NULL, (UCHAR FAR *)inConnectionStr.c_str(),
-                            inConnectionStr.Length(), (UCHAR FAR *)outConnectBuffer,
+        retcode = SQLDriverConnect(hdbc, NULL, (SQLTCHAR FAR *)inConnectionStr.c_str(),
+                            inConnectionStr.Length(), (SQLTCHAR FAR *)outConnectBuffer,
                             sizeof(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE);
 
         if ((retcode != SQL_SUCCESS) &&
index 5db3049439001d54cc8473ef61efa1867325b18e..60d1821805ffd2f3a2ee3712604d945e49a47eaa 100644 (file)
@@ -1326,7 +1326,7 @@ void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere,
                         wxString strMsg;
                         strMsg.Printf(wxT("wxDbTable::bindParams(): Unknown column type for colDefs %d colName %s"),
                                     colNo,colDefs[colNo].ColName);
-                        wxFAIL_MSG(wxT(strMsg));
+                        wxFAIL_MSG(strMsg.c_str());
                     }
                     break;
             }