Unicode compilation fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27328 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
George Tasker
2004-05-18 01:55:15 +00:00
parent 6644cbe7fb
commit 2cb4351487
2 changed files with 14 additions and 12 deletions

View File

@@ -753,9 +753,9 @@ bool wxDb::open(bool failOnDataTypeUnsupported)
bool wxDb::Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported) bool wxDb::Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported)
{ {
wxASSERT(inConnectStr.Length()); wxASSERT(inConnectStr.Length());
dsn = ""; dsn = wxT("");
uid = ""; uid = wxT("");
authStr = ""; authStr = wxT("");
RETCODE retcode; RETCODE retcode;
@@ -770,17 +770,19 @@ bool wxDb::Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported)
cout << wxT("SQLSetConnectOption(CURSOR_LIB) successful") << endl; cout << wxT("SQLSetConnectOption(CURSOR_LIB) successful") << endl;
else else
cout << wxT("SQLSetConnectOption(CURSOR_LIB) failed") << endl; cout << wxT("SQLSetConnectOption(CURSOR_LIB) failed") << endl;
#else
wxUnusedVar(retcode);
#endif #endif
} }
// Connect to the data source // 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; short outConnectBufferLen;
inConnectionStr = inConnectStr; inConnectionStr = inConnectStr;
retcode = SQLDriverConnect(hdbc, NULL, (UCHAR FAR *)inConnectionStr.c_str(), retcode = SQLDriverConnect(hdbc, NULL, (SQLTCHAR FAR *)inConnectionStr.c_str(),
inConnectionStr.Length(), (UCHAR FAR *)outConnectBuffer, inConnectionStr.Length(), (SQLTCHAR FAR *)outConnectBuffer,
sizeof(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE ); sizeof(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE );
if ((retcode != SQL_SUCCESS) && if ((retcode != SQL_SUCCESS) &&
@@ -802,8 +804,8 @@ bool wxDb::Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthSt
uid = Uid; uid = Uid;
authStr = AuthStr; authStr = AuthStr;
inConnectionStr = ""; inConnectionStr = wxT("");
outConnectionStr = ""; outConnectionStr = wxT("");
RETCODE retcode; RETCODE retcode;
@@ -879,13 +881,13 @@ bool wxDb::Open(wxDb *copyDb)
if (copyDb->OpenedWithConnectionString()) if (copyDb->OpenedWithConnectionString())
{ {
// Connect to the data source // Connect to the data source
UCHAR outConnectBuffer[SQL_MAX_CONNECTSTR_LEN+1]; SQLTCHAR outConnectBuffer[SQL_MAX_CONNECTSTR_LEN+1];
short outConnectBufferLen; short outConnectBufferLen;
inConnectionStr = copyDb->GetConnectionInStr(); inConnectionStr = copyDb->GetConnectionInStr();
retcode = SQLDriverConnect(hdbc, NULL, (UCHAR FAR *)inConnectionStr.c_str(), retcode = SQLDriverConnect(hdbc, NULL, (SQLTCHAR FAR *)inConnectionStr.c_str(),
inConnectionStr.Length(), (UCHAR FAR *)outConnectBuffer, inConnectionStr.Length(), (SQLTCHAR FAR *)outConnectBuffer,
sizeof(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE); sizeof(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE);
if ((retcode != SQL_SUCCESS) && if ((retcode != SQL_SUCCESS) &&

View File

@@ -1326,7 +1326,7 @@ void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere,
wxString strMsg; wxString strMsg;
strMsg.Printf(wxT("wxDbTable::bindParams(): Unknown column type for colDefs %d colName %s"), strMsg.Printf(wxT("wxDbTable::bindParams(): Unknown column type for colDefs %d colName %s"),
colNo,colDefs[colNo].ColName); colNo,colDefs[colNo].ColName);
wxFAIL_MSG(wxT(strMsg)); wxFAIL_MSG(strMsg.c_str());
} }
break; break;
} }