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

  1. // coursset.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 "stdreg.h"
  15. #include "coursset.h"
  16.  
  17. #ifdef _DEBUG
  18. #undef THIS_FILE
  19. static char BASED_CODE THIS_FILE[] = __FILE__;
  20. #endif
  21.  
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CCourseSet
  24.  
  25. IMPLEMENT_DYNAMIC(CCourseSet, CRecordset)
  26.  
  27. CCourseSet::CCourseSet(CDatabase* pdb)
  28.     : CRecordset(pdb)
  29. {
  30.     //{{AFX_FIELD_INIT(CCourseSet)
  31.     m_CourseID = "";
  32.     m_CourseTitle = "";
  33.     m_Hours = 0;
  34.     m_nFields = 3;
  35.     //}}AFX_FIELD_INIT
  36. }
  37.  
  38.  
  39. CString CCourseSet::GetDefaultConnect()
  40. {
  41.     return "ODBC;DSN=Student Registration;";
  42. }
  43.  
  44. CString CCourseSet::GetDefaultSQL()
  45. {
  46.     return "COURSE";
  47. }
  48.  
  49. void CCourseSet::DoFieldExchange(CFieldExchange* pFX)
  50. {
  51.     //{{AFX_FIELD_MAP(CCourseSet)
  52.     pFX->SetFieldType(CFieldExchange::outputColumn);
  53.     RFX_Text(pFX, "CourseID", m_CourseID);
  54.     RFX_Text(pFX, "CourseTitle", m_CourseTitle);
  55.     RFX_Int(pFX, "Hours", m_Hours);
  56.     //}}AFX_FIELD_MAP
  57. }
  58.  
  59. /////////////////////////////////////////////////////////////////////////////
  60. // CCourseSet diagnostics
  61.  
  62. #ifdef _DEBUG
  63. void CCourseSet::AssertValid() const
  64. {
  65.     CRecordset::AssertValid();
  66. }
  67.  
  68. void CCourseSet::Dump(CDumpContext& dc) const
  69. {
  70.     CRecordset::Dump(dc);
  71. }
  72. #endif //_DEBUG
  73.