X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0907ea9c5826258c7fda17f9db921539f5cde5ea..b6a20a20d010d643e52914f51aa0700df0da925f:/src/common/db.cpp?ds=sidebyside diff --git a/src/common/db.cpp b/src/common/db.cpp index 6f07ddc635..8403a4ca42 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -22,12 +22,12 @@ // Notice: This class library and its intellectual design are free of charge for use, // modification, enhancement, debugging under the following conditions: // 1) These classes may only be used as part of the implementation of a -// wxWindows-based application -// 2) All enhancements and bug fixes are to be submitted back to the wxWindows -// user groups free of all charges for use with the wxWindows library. +// wxWidgets-based application +// 2) All enhancements and bug fixes are to be submitted back to the wxWidgets +// user groups free of all charges for use with the wxWidgets library. // 3) These classes may not be distributed as part of any other class library, // DLL, text (written or electronic), other than a complete distribution of -// the wxWindows GUI development toolkit. +// the wxWidgets GUI development toolkit. /////////////////////////////////////////////////////////////////////////////// /* @@ -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) && @@ -1656,7 +1658,7 @@ void wxDb::Close(void) #ifdef __WXDEBUG__ wxTablesInUse *tiu; - wxNode *pNode; + wxList::compatibility_iterator pNode; pNode = TablesInUse.GetFirst(); wxString s,s2; while (pNode) @@ -2915,7 +2917,7 @@ wxDbColInf *wxDb::GetColumns(const wxString &tableName, int *numCols, const wxCh #ifdef __WXDEBUG__ default: wxString errMsg; - errMsg.Printf(wxT("SQL Data type %d currently not supported by wxWindows"), colInf[colNo].sqlDataType); + errMsg.Printf(wxT("SQL Data type %d currently not supported by wxWidgets"), colInf[colNo].sqlDataType); wxLogDebug(errMsg,wxT("ODBC DEBUG MESSAGE")); #endif }