2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
// Name: browsedb.h
|
2000-07-15 15:51:35 -04:00
|
|
|
// Purpose: a wxDb class
|
2001-02-12 14:23:44 -05:00
|
|
|
// Author: Mark Johnson
|
2000-01-28 10:25:32 -05:00
|
|
|
// Modified by:
|
|
|
|
// Created: 19991127.mj10777
|
|
|
|
// Copyright: (c) Mark Johnson
|
|
|
|
// Licence: wxWindows license
|
2000-01-31 08:20:36 -05:00
|
|
|
// RCS-ID: $Id$
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
//-- Zu tun in browsedb.h
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
//-- 1)
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
// Global structure for holding ODBC connection information
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2001-02-03 12:55:00 -05:00
|
|
|
//extern wxDbConnectInf DbConnectInf;
|
2000-02-21 03:05:13 -05:00
|
|
|
class MainDoc;
|
2001-02-01 15:24:44 -05:00
|
|
|
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
class BrowserDB
|
|
|
|
{
|
2001-02-01 15:24:44 -05:00
|
|
|
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();
|
2001-02-03 12:55:00 -05:00
|
|
|
void PointerToNULL(int Art);
|
2001-02-01 15:24:44 -05:00
|
|
|
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);
|
2004-01-11 17:08:25 -05:00
|
|
|
wxDbColInf* OnGetColumns(wxChar *tableName, UWORD numCols,int Quiet);
|
2001-02-01 15:24:44 -05:00
|
|
|
void OnFillSqlTyp();
|
|
|
|
void OnFilldbTyp();
|
|
|
|
//---------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
}; // BrowserDB class definition
|
2001-02-01 15:24:44 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|