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

  1. // MyRecordset3.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "odbc2.h"
  6. #include "MyRecordset3.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. // CMyRecordset3
  16.  
  17. IMPLEMENT_DYNAMIC(CMyRecordset3, CRecordset)
  18.  
  19. CMyRecordset3::CMyRecordset3(CDatabase* pdb)
  20.     : CRecordset(pdb)
  21. {
  22.     //{{AFX_FIELD_INIT(CMyRecordset3)
  23.     m_ID = 0;
  24.     m_Field1 = _T("");
  25.     m_nFields = 2;
  26.     //}}AFX_FIELD_INIT
  27.     m_nDefaultType = snapshot;
  28.  
  29.     m_nParams= 1;
  30. }
  31.  
  32.  
  33. CString CMyRecordset3::GetDefaultConnect()
  34. {
  35.     return _T("ODBC;DSN=TestDataSource");
  36. }
  37.  
  38. CString CMyRecordset3::GetDefaultSQL()
  39. {
  40.     return _T("{call Query1(?)}");
  41. }
  42.  
  43. void CMyRecordset3::DoFieldExchange(CFieldExchange* pFX)
  44. {
  45.     //{{AFX_FIELD_MAP(CMyRecordset3)
  46.     pFX->SetFieldType(CFieldExchange::outputColumn);
  47.     RFX_Long(pFX, _T("[ID]"), m_ID);
  48.     RFX_Text(pFX, _T("[Field1]"), m_Field1);
  49.     //}}AFX_FIELD_MAP
  50.     pFX->SetFieldType( CFieldExchange::inputParam );
  51.     RFX_Long(pFX, _T(""), m_IDParam);
  52. }
  53.  
  54. /////////////////////////////////////////////////////////////////////////////
  55. // CMyRecordset3 diagnostics
  56.  
  57. #ifdef _DEBUG
  58. void CMyRecordset3::AssertValid() const
  59. {
  60.     CRecordset::AssertValid();
  61. }
  62.  
  63. void CMyRecordset3::Dump(CDumpContext& dc) const
  64. {
  65.     CRecordset::Dump(dc);
  66. }
  67. #endif //_DEBUG
  68.