home *** CD-ROM | disk | FTP | other *** search
- // MyRecordset.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "odbc2.h"
- #include "MyRecordset.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CMyRecordset
-
- IMPLEMENT_DYNAMIC(CMyRecordset, CRecordset)
-
- CMyRecordset::CMyRecordset(CDatabase* pdb)
- : CRecordset(pdb)
- {
- //{{AFX_FIELD_INIT(CMyRecordset)
- m_ID = 0;
- m_Field1 = _T("");
- m_nFields = 2;
- //}}AFX_FIELD_INIT
- m_nDefaultType = snapshot;
-
- m_sql= _T("[Table1]");
-
- }
-
-
- CString CMyRecordset::GetDefaultConnect()
- {
- return _T("ODBC;DSN=TestDataSource");
- }
-
- CString CMyRecordset::GetDefaultSQL()
- {
- return _T("[Table1]");
- // return _T("[Query1]");
- }
-
- void CMyRecordset::DoFieldExchange(CFieldExchange* pFX)
- {
- //{{AFX_FIELD_MAP(CMyRecordset)
- pFX->SetFieldType(CFieldExchange::outputColumn);
- RFX_Long(pFX, _T("[ID]"), m_ID);
- RFX_Text(pFX, _T("[Field1]"), m_Field1);
- //}}AFX_FIELD_MAP
-
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMyRecordset diagnostics
-
- #ifdef _DEBUG
- void CMyRecordset::AssertValid() const
- {
- CRecordset::AssertValid();
- }
-
- void CMyRecordset::Dump(CDumpContext& dc) const
- {
- CRecordset::Dump(dc);
- }
- #endif //_DEBUG
-
- void CMyRecordset::SetDefaultSQL(CString& sql)
- {
- m_sql= sql;
- }
-