Huge cleanup of the code. Reformatting, spelling fixes, standardizing on wxWindows conventions, etc.
Changed the couple lines of code required to work with checkins of the new ODBC classes that use wxStrings. Fixed a ton of memory leaks Demo still crashes on exit though - this problem has exited for nearly a year though. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -16,62 +16,63 @@
|
||||
//----------------------------------------------------------------------------------------
|
||||
extern wxDbConnectInf DbConnectInf;
|
||||
class MainDoc;
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
class BrowserDB
|
||||
{
|
||||
public:
|
||||
//---------------------------------------------------------------------------------------
|
||||
// Pointer to the main database connection used in the program. This
|
||||
// pointer would normally be used for doing things as database lookups
|
||||
// for user login names and passwords, getting workstation settings, etc.
|
||||
// ---> IMPORTANT <---
|
||||
//
|
||||
// For each database object created which uses this wxDb pointer
|
||||
// connection to the database, when a CommitTrans() or RollBackTrans()
|
||||
// will commit or rollback EVERY object which uses this wxDb pointer.
|
||||
//
|
||||
// To allow each table object (those derived from wxDbTable) to be
|
||||
// individually committed or rolled back, you MUST use a different
|
||||
// instance of wxDb in the constructor of the table. Doing so creates
|
||||
// more overhead, and will use more database connections (some DBs have
|
||||
// connection limits...), so use connections sparringly.
|
||||
//
|
||||
// It is recommended that one "main" database connection be created for
|
||||
// the entire program to use for READ-ONLY database accesses, but for each
|
||||
// table object which will do a CommitTrans() or RollbackTrans() that a
|
||||
// new wxDb object be created and used for it.
|
||||
//---------------------------------------------------------------------------------------
|
||||
wxDb* db_BrowserDB;
|
||||
wxDbInf* ct_BrowserDB;
|
||||
wxDbColInf* cl_BrowserDB;
|
||||
wxString ODBCSource, UserName, Password;
|
||||
MainDoc *pDoc;
|
||||
//---------------------------------------------------------------------------------------
|
||||
wxString Temp0, Temp1, Temp2, Temp3, Temp4, Temp5;
|
||||
wxString ODBCText;
|
||||
wxTextCtrl* p_LogWindow;
|
||||
wxString s_SqlTyp[25];
|
||||
int i_SqlTyp[25];
|
||||
wxString s_dbTyp[5];
|
||||
int i_dbTyp[5];
|
||||
int i_Which;
|
||||
int i_Records;
|
||||
int i_Cols;
|
||||
//---------------------------------------------------------------------------------------
|
||||
BrowserDB();
|
||||
~BrowserDB();
|
||||
void Zeiger_auf_NULL(int Art);
|
||||
bool Initialize(int Quiet);
|
||||
//---------------------------------------------------------------------------------------
|
||||
bool OnStartDB(int Quiet);
|
||||
bool OnCloseDB(int Quiet);
|
||||
bool OnSelect(wxString tb_Name,int Quiet);
|
||||
bool OnExecSql(wxString SQLStmt,int Quiet);
|
||||
bool OnGetNext(int Cols,int Quiet);
|
||||
wxDbInf* OnGetCatalog(int Quiet);
|
||||
wxDbColInf* OnGetColumns(char *tableName, int numCols,int Quiet);
|
||||
void OnFillSqlTyp();
|
||||
void OnFilldbTyp();
|
||||
//---------------------------------------------------------------------------------------
|
||||
public:
|
||||
//---------------------------------------------------------------------------------------
|
||||
// Pointer to the main database connection used in the program. This
|
||||
// pointer would normally be used for doing things as database lookups
|
||||
// for user login names and passwords, getting workstation settings, etc.
|
||||
// ---> IMPORTANT <---
|
||||
//
|
||||
// For each database object created which uses this wxDb pointer
|
||||
// connection to the database, when a CommitTrans() or RollBackTrans()
|
||||
// will commit or rollback EVERY object which uses this wxDb pointer.
|
||||
//
|
||||
// To allow each table object (those derived from wxDbTable) to be
|
||||
// individually committed or rolled back, you MUST use a different
|
||||
// instance of wxDb in the constructor of the table. Doing so creates
|
||||
// more overhead, and will use more database connections (some DBs have
|
||||
// connection limits...), so use connections sparringly.
|
||||
//
|
||||
// It is recommended that one "main" database connection be created for
|
||||
// the entire program to use for READ-ONLY database accesses, but for each
|
||||
// table object which will do a CommitTrans() or RollbackTrans() that a
|
||||
// new wxDb object be created and used for it.
|
||||
//---------------------------------------------------------------------------------------
|
||||
wxDb* db_BrowserDB;
|
||||
wxDbInf* ct_BrowserDB;
|
||||
wxDbColInf* cl_BrowserDB;
|
||||
wxString ODBCSource, UserName, Password;
|
||||
MainDoc *pDoc;
|
||||
//---------------------------------------------------------------------------------------
|
||||
wxString Temp0, Temp1, Temp2, Temp3, Temp4, Temp5;
|
||||
wxString ODBCText;
|
||||
wxTextCtrl* p_LogWindow;
|
||||
wxString s_SqlTyp[25];
|
||||
int i_SqlTyp[25];
|
||||
wxString s_dbTyp[5];
|
||||
int i_dbTyp[5];
|
||||
int i_Which;
|
||||
int i_Records;
|
||||
int i_Cols;
|
||||
//---------------------------------------------------------------------------------------
|
||||
BrowserDB();
|
||||
~BrowserDB();
|
||||
void Zeiger_auf_NULL(int Art);
|
||||
bool Initialize(int Quiet);
|
||||
//---------------------------------------------------------------------------------------
|
||||
bool OnStartDB(int Quiet);
|
||||
bool OnCloseDB(int Quiet);
|
||||
bool OnSelect(wxString tb_Name,int Quiet);
|
||||
bool OnExecSql(wxString SQLStmt,int Quiet);
|
||||
bool OnGetNext(int Cols,int Quiet);
|
||||
wxDbInf* OnGetCatalog(int Quiet);
|
||||
wxDbColInf* OnGetColumns(char *tableName, int numCols,int Quiet);
|
||||
void OnFillSqlTyp();
|
||||
void OnFilldbTyp();
|
||||
//---------------------------------------------------------------------------------------
|
||||
}; // BrowserDB class definition
|
||||
//----------------------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user