]> git.saurik.com Git - wxWidgets.git/blob - demos/dbbrowse/browsedb.h
Fix from Mumit Khan to allow mingw DLL compilation, v.2 :-)
[wxWidgets.git] / demos / dbbrowse / browsedb.h
1 //----------------------------------------------------------------------------------------
2 // Name: browsedb.h
3 // Purpose: a wxDB class
4 // Author: Mark Johnson, mj10777@gmx.net
5 // Modified by:
6 // Created: 19991127.mj10777
7 // Copyright: (c) Mark Johnson
8 // Licence: wxWindows license
9 // RCS-ID: $Id$
10 //----------------------------------------------------------------------------------------
11 //-- Zu tun in browsedb.h
12 //----------------------------------------------------------------------------------------
13 //-- 1)
14 //----------------------------------------------------------------------------------------
15 // Global structure for holding ODBC connection information
16 //----------------------------------------------------------------------------------------
17 extern struct DbStuff DbConnectInf;
18 class MainDoc;
19 //----------------------------------------------------------------------------------------
20 class BrowserDB
21 {
22 public:
23 //---------------------------------------------------------------------------------------
24 // Pointer to the main database connection used in the program. This
25 // pointer would normally be used for doing things as database lookups
26 // for user login names and passwords, getting workstation settings, etc.
27 // ---> IMPORTANT <---
28 //
29 // For each database object created which uses this wxDB pointer
30 // connection to the database, when a CommitTrans() or RollBackTrans()
31 // will commit or rollback EVERY object which uses this wxDB pointer.
32 //
33 // To allow each table object (those derived from wxTable) to be
34 // individually committed or rolled back, you MUST use a different
35 // instance of wxDB in the constructor of the table. Doing so creates
36 // more overhead, and will use more database connections (some DBs have
37 // connection limits...), so use connections sparringly.
38 //
39 // It is recommended that one "main" database connection be created for
40 // the entire program to use for READ-ONLY database accesses, but for each
41 // table object which will do a CommitTrans() or RollbackTrans() that a
42 // new wxDB object be created and used for it.
43 //---------------------------------------------------------------------------------------
44 wxDB* db_BrowserDB;
45 wxDbInf* ct_BrowserDB;
46 wxColInf* cl_BrowserDB;
47 wxString ODBCSource, UserName, Password;
48 MainDoc *pDoc;
49 //---------------------------------------------------------------------------------------
50 wxString Temp0, Temp1, Temp2, Temp3, Temp4, Temp5;
51 wxString ODBCText;
52 wxTextCtrl* p_LogWindow;
53 wxString s_SqlTyp[25];
54 int i_SqlTyp[25];
55 wxString s_dbTyp[5];
56 int i_dbTyp[5];
57 int i_Which;
58 int i_Records;
59 int i_Cols;
60 //---------------------------------------------------------------------------------------
61 BrowserDB();
62 ~BrowserDB();
63 void Zeiger_auf_NULL(int Art);
64 bool Initialize(int Quite);
65 //---------------------------------------------------------------------------------------
66 bool OnStartDB(int Quite);
67 bool OnCloseDB(int Quite);
68 bool OnSelect(wxString tb_Name,int Quite);
69 bool OnExecSql(wxString SQLStmt,int Quite);
70 bool OnGetNext(int Cols,int Quite);
71 wxDbInf* OnGetCatalog(int Quite);
72 wxColInf* OnGetColumns(char *tableName, int numCols,int Quite);
73 void OnFillSqlTyp();
74 void OnFilldbTyp();
75 //---------------------------------------------------------------------------------------
76 }; // BrowserDB class definition
77 //----------------------------------------------------------------------------------------