home *** CD-ROM | disk | FTP | other *** search
/ Supercompiler 1997 / SUPERCOMPILER97.iso / MS_DAO.SDK / DISK4 / DAOSDK.1 / daoemdoc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-11  |  2.6 KB  |  99 lines

  1. // DAOEMdoc.h : interface of the CDAOEMPDoc class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4.  
  5. class CCntrItem;
  6.  
  7. class CDAOEMPDoc : public COleDocument
  8. {
  9. protected: // create from serialization only
  10.     CDAOEMPDoc();
  11.     DECLARE_DYNCREATE(CDAOEMPDoc)
  12.  
  13. // Attributes
  14. public:
  15.     CdbRecordset    m_cEmpRecordSet;
  16.     BOOL            m_bConnected;
  17. protected:
  18.     CdbDBEngine        m_cDBEngine;
  19.     CdbDatabase        m_cEmpDatabase;
  20.     CdbBookmark        m_cLastGoodRecord;
  21.  
  22. // Operations
  23. public:
  24.     BOOL ConnectToDatabase(); //Opens a database 
  25.  
  26. // Overrides
  27.     // ClassWizard generated virtual function overrides
  28.     //{{AFX_VIRTUAL(CDAOEMPDoc)
  29.     public:
  30.     virtual BOOL OnNewDocument();
  31.     //}}AFX_VIRTUAL
  32.  
  33. // Implementation
  34. public:
  35.     virtual ~CDAOEMPDoc();
  36.     virtual void Serialize(CArchive& ar);   // overridden for document i/o
  37.     BOOL OKToMove();
  38.  
  39.     void UpdateEmpRec(long m_nEmpNum, LPCTSTR lpszFirstName, 
  40.             LPCTSTR lpszHomePhone, LPCTSTR lpszLastName,    
  41.             LPCTSTR lpszNotes, DATE HireDate);
  42.  
  43. #ifdef _DEBUG
  44.     virtual void AssertValid() const;
  45.     virtual void Dump(CDumpContext& dc) const;
  46. #endif
  47.  
  48. protected:
  49.  
  50. // Generated message map functions
  51. protected:
  52.     //{{AFX_MSG(CDAOEMPDoc)
  53.     afx_msg void OnEditNext();
  54.     afx_msg void OnEditPrevious();
  55.     afx_msg void OnEditAdd();
  56.     afx_msg void OnEditDelete();
  57.     afx_msg void OnUpdateEditDelete(CCmdUI* pCmdUI);
  58.     //}}AFX_MSG
  59.     DECLARE_MESSAGE_MAP()
  60. };
  61.  
  62. /////////////////////////////////////////////////////////////////////////////
  63. // Employee table field indices
  64. // DAO classes support numbered or named indexes
  65.  
  66. //#define    EMP_EMPLOYEE_ID    0L // Must use LONG or compiler gets confused with NULL
  67. //#define    EMP_LAST_NAME    1
  68. //#define    EMP_FIRST_NAME    2
  69. //#define    EMP_TITLE        3
  70. //#define    EMP_BIRTH_DATE    4
  71. //#define    EMP_HIRE_DATE    5
  72. //#define    EMP_ADDRESS        6
  73. //#define    EMP_CITY        7
  74. //#define    EMP_REGION        8
  75. //#define    EMP_POSTAL_CODE    9
  76. //#define    EMP_COUNTRY        10
  77. //#define    EMP_HOME_PHONE    11
  78. //#define    EMP_EXTENSION    12
  79. //#define    EMP_PHOTO        13
  80. //#define    EMP_NOTES        14
  81. //#define    EMP_REPORTS_TO    15
  82.  
  83. #define EMP_EMPLOYEE_ID    _T("EmployeeID")
  84. #define    EMP_LAST_NAME    _T("LastName")
  85. #define    EMP_FIRST_NAME    _T("FirstName")
  86. #define    EMP_TITLE        _T("Title")
  87. #define    EMP_BIRTH_DATE    _T("BirthDate")
  88. #define EMP_HIRE_DATE    _T("HireDate")
  89. #define EMP_ADDRESS        _T("Address")
  90. #define EMP_CITY        _T("City")
  91. #define EMP_REGION        _T("Region")
  92. #define EMP_POSTAL_CODE    _T("Postal Code")
  93. #define EMP_COUNTRY        _T("Country")
  94. #define EMP_HOME_PHONE    _T("HomePhone")
  95. #define EMP_EXTENSION    _T("Extension")
  96. #define EMP_PHOTO        _T("Photo")
  97. #define EMP_NOTES        _T("Notes")
  98. #define EMP_REPORTS_TO    _T("ReportsTo")
  99.