1 //----------------------------------------------------------------------------------------
3 // Purpose: a wxDb class
4 // Author: Mark Johnson, mj10777@gmx.net
6 // Created: 19991127.mj10777
7 // Copyright: (c) Mark Johnson
8 // Licence: wxWindows license
10 //----------------------------------------------------------------------------------------
11 //-- Zu tun in browsedb.h
12 //----------------------------------------------------------------------------------------
14 //----------------------------------------------------------------------------------------
15 // Global structure for holding ODBC connection information
16 //----------------------------------------------------------------------------------------
17 extern wxDbConnectInf DbConnectInf
;
20 //----------------------------------------------------------------------------------------
24 //---------------------------------------------------------------------------------------
25 // Pointer to the main database connection used in the program. This
26 // pointer would normally be used for doing things as database lookups
27 // for user login names and passwords, getting workstation settings, etc.
28 // ---> IMPORTANT <---
30 // For each database object created which uses this wxDb pointer
31 // connection to the database, when a CommitTrans() or RollBackTrans()
32 // will commit or rollback EVERY object which uses this wxDb pointer.
34 // To allow each table object (those derived from wxDbTable) to be
35 // individually committed or rolled back, you MUST use a different
36 // instance of wxDb in the constructor of the table. Doing so creates
37 // more overhead, and will use more database connections (some DBs have
38 // connection limits...), so use connections sparringly.
40 // It is recommended that one "main" database connection be created for
41 // the entire program to use for READ-ONLY database accesses, but for each
42 // table object which will do a CommitTrans() or RollbackTrans() that a
43 // new wxDb object be created and used for it.
44 //---------------------------------------------------------------------------------------
46 wxDbInf
* ct_BrowserDB
;
47 wxDbColInf
* cl_BrowserDB
;
48 wxString ODBCSource
, UserName
, Password
;
50 //---------------------------------------------------------------------------------------
51 wxString Temp0
, Temp1
, Temp2
, Temp3
, Temp4
, Temp5
;
53 wxTextCtrl
* p_LogWindow
;
54 wxString s_SqlTyp
[25];
61 //---------------------------------------------------------------------------------------
64 void Zeiger_auf_NULL(int Art
);
65 bool Initialize(int Quiet
);
66 //---------------------------------------------------------------------------------------
67 bool OnStartDB(int Quiet
);
68 bool OnCloseDB(int Quiet
);
69 bool OnSelect(wxString tb_Name
,int Quiet
);
70 bool OnExecSql(wxString SQLStmt
,int Quiet
);
71 bool OnGetNext(int Cols
,int Quiet
);
72 wxDbInf
* OnGetCatalog(int Quiet
);
73 wxDbColInf
* OnGetColumns(char *tableName
, int numCols
,int Quiet
);
76 //---------------------------------------------------------------------------------------
77 }; // BrowserDB class definition
78 //----------------------------------------------------------------------------------------