]>
Commit | Line | Data |
---|---|---|
c92b0f9a | 1 | //---------------------------------------------------------------------------------------- |
b5ffecfc | 2 | // Name: browsedb.h |
f6bcfd97 | 3 | // Purpose: a wxDb class |
b5ffecfc GT |
4 | // Author: Mark Johnson, mj10777@gmx.net |
5 | // Modified by: | |
6 | // Created: 19991127.mj10777 | |
7 | // Copyright: (c) Mark Johnson | |
8 | // Licence: wxWindows license | |
c09d434d | 9 | // RCS-ID: $Id$ |
c92b0f9a | 10 | //---------------------------------------------------------------------------------------- |
b5ffecfc | 11 | //-- Zu tun in browsedb.h |
c92b0f9a | 12 | //---------------------------------------------------------------------------------------- |
b5ffecfc | 13 | //-- 1) |
c92b0f9a | 14 | //---------------------------------------------------------------------------------------- |
b5ffecfc | 15 | // Global structure for holding ODBC connection information |
c92b0f9a | 16 | //---------------------------------------------------------------------------------------- |
e2f1cfb2 | 17 | extern wxDbConnectInf DbConnectInf; |
3fa0976a | 18 | class MainDoc; |
c92b0f9a | 19 | //---------------------------------------------------------------------------------------- |
b5ffecfc GT |
20 | class BrowserDB |
21 | { | |
22 | public: | |
c92b0f9a | 23 | //--------------------------------------------------------------------------------------- |
b5ffecfc GT |
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 | // | |
f6bcfd97 | 29 | // For each database object created which uses this wxDb pointer |
b5ffecfc | 30 | // connection to the database, when a CommitTrans() or RollBackTrans() |
f6bcfd97 | 31 | // will commit or rollback EVERY object which uses this wxDb pointer. |
b5ffecfc | 32 | // |
f6bcfd97 | 33 | // To allow each table object (those derived from wxDbTable) to be |
b5ffecfc | 34 | // individually committed or rolled back, you MUST use a different |
f6bcfd97 | 35 | // instance of wxDb in the constructor of the table. Doing so creates |
b5ffecfc GT |
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 | |
f6bcfd97 | 42 | // new wxDb object be created and used for it. |
c92b0f9a | 43 | //--------------------------------------------------------------------------------------- |
f6bcfd97 | 44 | wxDb* db_BrowserDB; |
b5ffecfc | 45 | wxDbInf* ct_BrowserDB; |
f6bcfd97 | 46 | wxDbColInf* cl_BrowserDB; |
b5ffecfc | 47 | wxString ODBCSource, UserName, Password; |
3fa0976a | 48 | MainDoc *pDoc; |
c92b0f9a | 49 | //--------------------------------------------------------------------------------------- |
b5ffecfc GT |
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; | |
c92b0f9a | 60 | //--------------------------------------------------------------------------------------- |
b5ffecfc GT |
61 | BrowserDB(); |
62 | ~BrowserDB(); | |
63 | void Zeiger_auf_NULL(int Art); | |
f6bcfd97 | 64 | bool Initialize(int Quiet); |
c92b0f9a | 65 | //--------------------------------------------------------------------------------------- |
f6bcfd97 BP |
66 | bool OnStartDB(int Quiet); |
67 | bool OnCloseDB(int Quiet); | |
68 | bool OnSelect(wxString tb_Name,int Quiet); | |
69 | bool OnExecSql(wxString SQLStmt,int Quiet); | |
70 | bool OnGetNext(int Cols,int Quiet); | |
71 | wxDbInf* OnGetCatalog(int Quiet); | |
72 | wxDbColInf* OnGetColumns(char *tableName, int numCols,int Quiet); | |
b5ffecfc GT |
73 | void OnFillSqlTyp(); |
74 | void OnFilldbTyp(); | |
c92b0f9a | 75 | //--------------------------------------------------------------------------------------- |
b5ffecfc | 76 | }; // BrowserDB class definition |
c92b0f9a | 77 | //---------------------------------------------------------------------------------------- |