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 / sectset.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  1.9 KB  |  79 lines

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