home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / samples / c09 / odbc2 / myrecordset2.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  2.0 KB  |  89 lines

  1. // MyRecordset2.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "odbc2.h"
  6. #include "MyRecordset2.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CMyRecordset2
  16.  
  17. IMPLEMENT_DYNAMIC(CMyRecordset2, CRecordset)
  18.  
  19. CMyRecordset2::CMyRecordset2(CDatabase* pdb)
  20.     : CRecordset(pdb)
  21. {
  22.     //{{AFX_FIELD_INIT(CMyRecordset2)
  23.     m_major = 0;
  24.     m_minor = 0;
  25.     m_width = 0;
  26.     m_priority = 0;
  27.     m_RGBColor = _T("");
  28.     m_threshold = 0;
  29.     m_style = _T("");
  30.     m_hatch = _T("");
  31.     m_colorref = 0;
  32.     m_description = _T("");
  33.     m_pDescription = NULL;
  34.     m_nFields = 11;
  35.     //}}AFX_FIELD_INIT
  36.     m_nDefaultType = snapshot;
  37. }
  38.  
  39.  
  40. CString CMyRecordset2::GetDefaultConnect()
  41. {
  42.     return _T("ODBC;DSN=Rowset");
  43. }
  44.  
  45. CString CMyRecordset2::GetDefaultSQL()
  46. {
  47.     return _T("[attributes]");
  48. }
  49.  
  50. void CMyRecordset2::DoFieldExchange(CFieldExchange* pFX)
  51. {
  52.     //{{AFX_FIELD_MAP(CMyRecordset2)
  53.     pFX->SetFieldType(CFieldExchange::outputColumn);
  54.     RFX_Int(pFX, _T("[major]"), m_major);
  55.     RFX_Int(pFX, _T("[minor]"), m_minor);
  56.     RFX_Int(pFX, _T("[width]"), m_width);
  57.     RFX_Int(pFX, _T("[priority]"), m_priority);
  58.     RFX_Text(pFX, _T("[RGBColor]"), m_RGBColor);
  59.     RFX_Long(pFX, _T("[threshold]"), m_threshold);
  60.     RFX_Text(pFX, _T("[style]"), m_style);
  61.     RFX_Text(pFX, _T("[hatch]"), m_hatch);
  62.     RFX_Long(pFX, _T("[colorref]"), m_colorref);
  63.     RFX_Text(pFX, _T("[description]"), m_description);
  64.  
  65.     //}}AFX_FIELD_MAP
  66. }
  67. void CMyRecordset2::DoBulkFieldExchange(CFieldExchange * pFX)
  68. {
  69.     pFX->SetFieldType(CFieldExchange::outputColumn);
  70.     RFX_Text_Bulk(pFX, _T("[description]"), NULL, NULL, NULL);
  71.  
  72. }
  73.  
  74. /////////////////////////////////////////////////////////////////////////////
  75. // CMyRecordset2 diagnostics
  76.  
  77. #ifdef _DEBUG
  78. void CMyRecordset2::AssertValid() const
  79. {
  80.     CRecordset::AssertValid();
  81. }
  82.  
  83. void CMyRecordset2::Dump(CDumpContext& dc) const
  84. {
  85.     CRecordset::Dump(dc);
  86. }
  87. #endif //_DEBUG
  88.  
  89.