home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / database / daoenrol / coursese.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  1.7 KB  |  70 lines

  1. // coursese.cpp : implementation file
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "DaoEnrol.h"
  15. #include "coursese.h"
  16.  
  17. #ifdef _DEBUG
  18. #define new DEBUG_NEW
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CCourseSet
  25.  
  26. IMPLEMENT_DYNAMIC(CCourseSet, CDaoRecordset)
  27.  
  28. CCourseSet::CCourseSet(CDaoDatabase* pdb)
  29.     : CDaoRecordset(pdb)
  30. {
  31.     //{{AFX_FIELD_INIT(CCourseSet)
  32.     m_CourseID = _T("");
  33.     m_CourseTitle = _T("");
  34.     m_Hours = 0;
  35.     m_nFields = 3;
  36.     //}}AFX_FIELD_INIT
  37.     m_nDefaultType = dbOpenDynaset;
  38. }
  39.  
  40.  
  41. CString CCourseSet::GetDefaultSQL()
  42. {
  43.     return _T("[Course]");
  44. }
  45.  
  46. void CCourseSet::DoFieldExchange(CDaoFieldExchange* pFX)
  47. {
  48.     //{{AFX_FIELD_MAP(CCourseSet)
  49.     pFX->SetFieldType(CDaoFieldExchange::outputColumn);
  50.     DFX_Text(pFX, _T("[CourseID]"), m_CourseID);
  51.     DFX_Text(pFX, _T("[CourseTitle]"), m_CourseTitle);
  52.     DFX_Short(pFX, _T("[Hours]"), m_Hours);
  53.     //}}AFX_FIELD_MAP
  54. }
  55.  
  56. /////////////////////////////////////////////////////////////////////////////
  57. // CCourseSet diagnostics
  58.  
  59. #ifdef _DEBUG
  60. void CCourseSet::AssertValid() const
  61. {
  62.     CDaoRecordset::AssertValid();
  63. }
  64.  
  65. void CCourseSet::Dump(CDumpContext& dc) const
  66. {
  67.     CDaoRecordset::Dump(dc);
  68. }
  69. #endif //_DEBUG
  70.