File: browsedb.h

package info (click to toggle)
wxwidgets2.6 2.6.3.2.1.5%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 83,228 kB
  • ctags: 130,941
  • sloc: cpp: 820,043; ansic: 113,030; python: 107,485; makefile: 42,996; sh: 10,305; lex: 194; yacc: 128; xml: 95; pascal: 74
file content (78 lines) | stat: -rw-r--r-- 3,875 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//----------------------------------------------------------------------------------------
// Name:        browsedb.h
// Purpose:     a wxDb class
// Author:      Mark Johnson
// Modified by:
// Created:     19991127.mj10777
// Copyright:   (c) Mark Johnson
// Licence:     wxWindows license
// RCS-ID:      $Id: browsedb.h,v 1.12 2004/01/11 22:08:25 JS Exp $
//----------------------------------------------------------------------------------------
//-- Zu tun in browsedb.h
//----------------------------------------------------------------------------------------
//-- 1)
//----------------------------------------------------------------------------------------
// Global structure for holding ODBC connection information
//----------------------------------------------------------------------------------------
//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 PointerToNULL(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(wxChar *tableName, UWORD numCols,int Quiet);
    void           OnFillSqlTyp();
    void           OnFilldbTyp();
    //---------------------------------------------------------------------------------------
};  // BrowserDB class definition
    //----------------------------------------------------------------------------------------