home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / vcoledb / consumer / catdb / catdbdoc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  2.0 KB  |  90 lines

  1. // Cat3Doc.h : interface of the CCatDBDoc class
  2. //
  3. // This is a part of the Microsoft Foundation Classes and
  4. // Templates (MFC&T).
  5. // Copyright (C) 1998 Microsoft Corporation
  6. // All rights reserved.
  7. //
  8. // This source code is only intended as a supplement to the
  9. // MFC&T Reference and related electronic documentation provided
  10. // with the library.  See these sources for detailed information
  11. // regarding the MFC&T product.
  12. //
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15.  
  16. class CCatDBDoc : public CDocument
  17. {
  18. protected: // create from serialization only
  19.     int GetProfileValue(LPCTSTR lpszSection,LPCTSTR lpszItem);
  20.     CCatDBDoc();
  21.     DECLARE_DYNCREATE(CCatDBDoc)
  22.  
  23. // Attributes
  24. public:
  25.     CString m_strConnect;
  26.     // Database Connection
  27.     CDataSource m_source;
  28.     CSession    m_session;
  29.  
  30.     // Table Information
  31.     CTables* m_pTableset;
  32.     BOOL m_bSystemTables;
  33.     BOOL m_bViews;
  34.     BOOL m_bSynonyms;
  35.  
  36.     // Column Information
  37.     CColumns* m_pColumnset;
  38.     BOOL m_bLength;
  39.     BOOL m_bPrecision;
  40.     BOOL m_bNullability;
  41.  
  42.     // Level Information
  43.     enum Level
  44.     {
  45.         levelNone,
  46.         levelTable,
  47.         levelColumn
  48.     };
  49.  
  50.     Level       m_nLevel;
  51.     CString     m_strTableName;
  52.  
  53.  
  54. // Operations
  55. public:
  56.     void SetLevel(Level nLevel);
  57.     CString GetDSN();
  58.     void    FetchColumnInfo(LPCSTR lpszName);
  59.     BOOL    FetchTableInfo();
  60.  
  61. // Overrides
  62.     // ClassWizard generated virtual function overrides
  63.     //{{AFX_VIRTUAL(CCatDBDoc)
  64.     public:
  65.     virtual BOOL OnNewDocument();
  66.     virtual void Serialize(CArchive& ar);
  67.     virtual BOOL OnOpenDocument();
  68.     virtual void OnCloseDocument();
  69.     //}}AFX_VIRTUAL
  70.  
  71. // Implementation
  72. public:
  73.     virtual ~CCatDBDoc();
  74. #ifdef _DEBUG
  75.     virtual void AssertValid() const;
  76.     virtual void Dump(CDumpContext& dc) const;
  77. #endif
  78.  
  79. protected:
  80.  
  81. // Generated message map functions
  82. protected:
  83.     //{{AFX_MSG(CCatDBDoc)
  84.     afx_msg void OnViewSettings();
  85.     //}}AFX_MSG
  86.     DECLARE_MESSAGE_MAP()
  87. };
  88.  
  89. /////////////////////////////////////////////////////////////////////////////
  90.