//----------------------------------------------------------------------------------------
// Name: doc.cpp
// Purpose: Holds information for DBBrowser - (a do-it-yourself document)
-// Author: Mark Johnson, mj10777@gmx.net
+// Author: Mark Johnson
// Modified by: 19990808.mj10777
// BJO : Bart A.M. JOURQUIN
// Created: 19990808
//----------------------------------------------------------------------------------------
//-- Some Global Vars for all Files (extern in ?.h needed) -------------------------------
// Global structure for holding ODBC connection information
-wxDbConnectInf DbConnectInf;
+extern wxDbConnectInf DbConnectInf;
//----------------------------------------------------------------------------------------
wxConfigBase *p_ProgramCfg; // All Config and Path information
i_TabNr = 0;
i_PageNr = 0;
s_BColour = "WHEAT";
- ft_Doc = new wxFont(wxSystemSettings::GetSystemFont(wxSYS_SYSTEM_FONT));
+ ft_Doc = new wxFont(wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT));
}
//----------------------------------------------------------------------------------------
int i = 0;
//---------------------------------------------------------------------------------------
// Initialize the ODBC Environment for Database Operations
-
- if (SQLAllocEnv(&DbConnectInf.Henv) != SQL_SUCCESS)
+
+ if (!DbConnectInf.AllocHenv())
{
return FALSE;
}
+
//---------------------------------------------------------------------------------------
const char sep = 3; // separator character used in string between DSN ans DsDesc
wxStringList s_SortDSNList, s_SortDsDescList;
// The key will be removed after sorting
wxString KeyString;
//---------------------------------------------------------------------------------------
- while(wxDbGetDataSource(DbConnectInf.Henv, Dsn, sizeof(Dsn), DsDesc, sizeof(DsDesc)))
+ while(wxDbGetDataSource(DbConnectInf.GetHenv(), Dsn, sizeof(Dsn), DsDesc, sizeof(DsDesc)))
{
i_DSN++; // How many Dsn have we ?
KeyString.Printf("%s%c%s",Dsn, sep, DsDesc);
(db_Br+i)->pDoc = this;
(db_Br+i)->i_Which = i;
}
- if (SQLFreeEnv(DbConnectInf.Henv) != SQL_SUCCESS) // BJO20000125 / MJ10777.20000309 : no &
- {
- // Error freeing environment handle
- }
+
+ DbConnectInf.FreeHenv();
+
delete [] s_SortDSN;
delete [] s_SortDsDesc;
//---------------------------------------------------------------------------------------