if (!OnStartDB(Quiet))
{
wxLogMessage(_("\n\n-E-> BrowserDB::OnStartDB(%s) : Failed ! "),ODBCSource.c_str());
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
} // BrowserDB:Initialize
//----------------------------------------------------------------------------------------
{
if (!Quiet)
wxLogMessage(_("\n-I-> BrowserDB::OnStartDB() : DB is already open."));
- return TRUE;
+ return true;
}
DbConnectInf.AllocHenv();
p_Dlg->s_Password = Password;
p_Dlg->OnInit();
p_Dlg->Fit();
-
- bool OK = FALSE;
+
+ bool OK = false;
if (p_Dlg->ShowModal() == wxID_OK)
{
(pDoc->p_DSN+i_Which)->Usr = p_Dlg->s_User;
(pDoc->p_DSN+i_Which)->Pas = p_Dlg->s_Password;
UserName = p_Dlg->s_User;
Password = p_Dlg->s_Password;
- OK = TRUE;
+ OK = true;
}
delete p_Dlg;
if (OK)
wxLogMessage(_("-I-> BrowserDB::OnStartDB(%s) : End - Time needed : %ld ms"),ODBCSource.c_str(),sw.Time());
}
DbConnectInf.FreeHenv();
- return FALSE;
+ return false;
}
//--------------------------------------------------------------------------------------
if (!Quiet)
wxLogMessage(_("-I-> BrowserDB::OnGetDataSourceODBC() - DatabaseName(%s) ; DataSource(%s)"),Temp1.c_str(),Temp2.c_str());
wxLogMessage(_("-I-> BrowserDB::OnStartDB(%s) : End - Time needed : %ld ms"),ODBCSource.c_str(),sw.Time());
}
- return TRUE;
+ return true;
}
else
{
DbConnectInf.FreeHenv();
- return FALSE;
+ return false;
}
}
}
if (!Quiet)
wxLogMessage(_("\n-I-> BrowserDB::OnCloseDB() : End "));
- return TRUE;
+ return true;
}
//----------------------------------------------------------------------------------------
wxLogMessage(Temp0);
wxMessageBox(Temp0);
#endif
- return FALSE;
+ return false;
}
else
{
{
case DB_DATA_TYPE_VARCHAR:
wxStrcpy(s_temp,_T(""));
- if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_dbDataType,&s_temp,sizeof(s_temp), &cb))
+ if (!db_BrowserDB->GetData((UWORD)(i+1),(SWORD)((cl_BrowserDB+i)->pColFor->i_dbDataType),&s_temp[0],sizeof(s_temp), &cb))
{
Temp0.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext of >%s<.\n-E-> "),(cl_BrowserDB+i)->tableName);
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
break;
case DB_DATA_TYPE_INTEGER:
l_temp = 0;
- if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&l_temp,sizeof(l_temp), &cb))
+ if (!db_BrowserDB->GetData((UWORD)(i+1),(SWORD)((cl_BrowserDB+i)->pColFor->i_sqlDataType),&l_temp,sizeof(l_temp), &cb))
{
Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
break;
case DB_DATA_TYPE_FLOAT:
f_temp = 0;
- if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&f_temp,sizeof(f_temp), &cb))
+ if (!db_BrowserDB->GetData((UWORD)(i+1),(SWORD)((cl_BrowserDB+i)->pColFor->i_sqlDataType),&f_temp,sizeof(f_temp), &cb))
{
Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
}
break;
case DB_DATA_TYPE_DATE:
- t_temp.day = t_temp.month = t_temp.year = t_temp.hour = t_temp.minute = t_temp.second = t_temp.fraction = 0;
- if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&t_temp,sizeof(t_temp), &cb))
+ t_temp.day = 0;
+ t_temp.month = 0;
+ t_temp.year = 0;
+ t_temp.hour = 0;
+ t_temp.minute = 0;
+ t_temp.second = 0;
+ t_temp.fraction = 0;
+ if (!db_BrowserDB->GetData((UWORD)(i+1),(SWORD)((cl_BrowserDB+i)->pColFor->i_sqlDataType),&t_temp,sizeof(t_temp), &cb))
{
Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
wxLogMessage(_("-E-> BrowserDB::OnGetNext - DB_DATA_TYPE_?? (%d) in Col(%s)"),(cl_BrowserDB+i)->pColFor->i_dbDataType,Temp0.c_str());
}
else
- return TRUE;
+ return true;
Temp0.Printf(_("-E-> unknown Format(%d) - sql(%d)"),(cl_BrowserDB+i)->pColFor->i_dbDataType,(cl_BrowserDB+i)->pColFor->i_sqlDataType);
wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
break;
} // for
} // else
- return TRUE;
+ return true;
}
//----------------------------------------------------------------------------------------
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
wxLogMessage(Temp0);
wxMessageBox(_T("-E-> BrowserDB::OnSelect - GetData()"));
- return FALSE;
+ return false;
}
//---------------------------------------------------------------------------------------
while (db_BrowserDB->GetNext())
Temp0.Printf(_("\n-E-> BrowserDB::OnSelect - ODBC-Error with ExecSql of >%s<.\n-E-> "),tb_Name.c_str());
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
wxLogMessage(Temp0);
- return FALSE;
+ return false;
}
//---------------------------------------------------------------------------------------
- // SetColDefs ( 0,"NAME", DB_DATA_TYPE_VARCHAR, Name, SQL_C_CHAR, sizeof(Name), TRUE, TRUE); // Primary index
+ // SetColDefs ( 0, "NAME", DB_DATA_TYPE_VARCHAR, Name, SQL_C_WXCHAR, sizeof(Name), true, true); // Primary index
//---------------------------------------------------------------------------------------
if (!Quiet)
{
wxLogMessage(_("\n-I-> BrowserDB::OnSelect(%s) Records(%d): End - Time needed : %ld ms"),tb_Name.c_str(),i_Records,sw.Time());
}
- return TRUE;
+ return true;
}
//----------------------------------------------------------------------------------------
wxLogMessage(Temp0);
else
wxMessageBox(_T("-E-> BrowserDB::OnExecSql - ExecSql()"));
- return FALSE;
+ return false;
}
if (!Quiet)
{
// wxLogMessage(_("\n-I-> BrowserDB::OnExecSql(%s) - End - Time needed : %ld ms"),SQLStmt.c_str(),sw.Time());
}
- return TRUE;
+ return true;
}
//----------------------------------------------------------------------------------------
(cl_BrowserDB+i)->pColFor->Format(1,
(cl_BrowserDB+i)->dbDataType,
(cl_BrowserDB+i)->sqlDataType,
- (cl_BrowserDB+i)->columnSize,
+ (cl_BrowserDB+i)->columnLength,
(cl_BrowserDB+i)->decimalDigits);
}
return cl_BrowserDB;
i_SqlTyp[1] = SQL_C_BINARY; s_SqlTyp[1] = _T("SQL_C_BINARY");
i_SqlTyp[2] = SQL_C_BIT; s_SqlTyp[2] = _T("SQL_C_BIT");
i_SqlTyp[3] = SQL_C_BOOKMARK; s_SqlTyp[3] = _T("SQL_C_BOOKMARK");
- i_SqlTyp[4] = SQL_C_CHAR; s_SqlTyp[4] = _T("SQL_C_CHAR");
+ i_SqlTyp[4] = SQL_C_WXCHAR; s_SqlTyp[4] = _T("SQL_C_WXCHAR");
i_SqlTyp[5] = SQL_C_DATE; s_SqlTyp[5] = _T("SQL_C_DATE");
i_SqlTyp[6] = SQL_C_DEFAULT; s_SqlTyp[6] = _T("SQL_C_DEFAULT");
i_SqlTyp[7] = SQL_C_DOUBLE; s_SqlTyp[7] = _T("SQL_C_DOUBLE");