X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a4054ad1cfd23565d59c2e14bd59201b37606f53..4b37e99afcedd67292c24e93677a83b76dc6b625:/samples/db/dbtest.cpp diff --git a/samples/db/dbtest.cpp b/samples/db/dbtest.cpp index 4c8037a85d..5b7ff2fa70 100644 --- a/samples/db/dbtest.cpp +++ b/samples/db/dbtest.cpp @@ -438,6 +438,20 @@ bool DatabaseDemoApp::OnInit() } // DatabaseDemoApp::OnInit() +/* +* Remove CR or CR/LF from a character string. +*/ +char* wxRemoveLineTerminator(char* aString) +{ + int len = strlen(aString); + while (len > 0 && (aString[len-1] == '\r' || aString[len-1] == '\n')) { + aString[len-1] = '\0'; + len--; + } + return aString; +} + + bool DatabaseDemoApp::ReadParamFile(Cparameters ¶ms) { FILE *paramFile; @@ -452,19 +466,19 @@ bool DatabaseDemoApp::ReadParamFile(Cparameters ¶ms) wxChar buffer[1000+1]; fgets(buffer, sizeof(params.ODBCSource), paramFile); - buffer[wxStrlen(buffer)-1] = wxT('\0'); + wxRemoveLineTerminator(buffer); wxStrcpy(params.ODBCSource,buffer); fgets(buffer, sizeof(params.UserName), paramFile); - buffer[wxStrlen(buffer)-1] = wxT('\0'); + wxRemoveLineTerminator(buffer); wxStrcpy(params.UserName,buffer); fgets(buffer, sizeof(params.Password), paramFile); - buffer[wxStrlen(buffer)-1] = wxT('\0'); + wxRemoveLineTerminator(buffer); wxStrcpy(params.Password,buffer); fgets(buffer, sizeof(params.DirPath), paramFile); - buffer[wxStrlen(buffer)-1] = wxT('\0'); + wxRemoveLineTerminator(buffer); wxStrcpy(params.DirPath,buffer); fclose(paramFile); @@ -1488,7 +1502,7 @@ bool CeditorDlg::GetData() } bool invalid = FALSE; - int mm,dd,yyyy; + int mm = 1,dd = 1,yyyy = 2001; int first, second; tStr = pJoinDateTxt->GetValue(); @@ -1868,7 +1882,11 @@ bool CparameterDlg::PutData() // Fill in the fields from the params object if (wxGetApp().params.ODBCSource && wxStrlen(wxGetApp().params.ODBCSource)) - pParamODBCSourceList->SetStringSelection(wxGetApp().params.ODBCSource); + { + int index = pParamODBCSourceList->FindString(wxGetApp().params.ODBCSource); + if (index != -1) + pParamODBCSourceList->SetSelection(index); + } pParamUserNameTxt->SetValue(wxGetApp().params.UserName); pParamPasswordTxt->SetValue(wxGetApp().params.Password); pParamDirPathTxt->SetValue(wxGetApp().params.DirPath); @@ -2651,6 +2669,9 @@ void DisplayDbDiagnostics(wxDb *pDb) } s += "\n"; +#ifdef __VMS__ +#pragma message disable incboodep +#endif comma = FALSE; s += langDBINF_TXN_ISOLATION_OPTS; if (pDb->dbInf.txnIsolationOptions & SQL_TXN_READ_UNCOMMITTED) @@ -2758,6 +2779,9 @@ void DisplayDbDiagnostics(wxDb *pDb) if (pDb->dbInf.staticSensitivity & SQL_SS_UPDATES) {if (comma++) s += ", "; s += langDBINF_UPDATES;} s += "\n"; +#ifdef __VMS__ +#pragma message enable incboodep +#endif s += langDBINF_TXN_CAPABLE;