📄 categoryset.cpp
字号:
// CategorySet.cpp : implementation file
//
#include "stdafx.h"
#include "CategorySet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCategorySet
IMPLEMENT_DYNAMIC(CCategorySet, CRecordset)
CCategorySet::CCategorySet(CDatabase* pdb)
: CRecordset(pdb)
{
//{{AFX_FIELD_INIT(CCategorySet)
m_CategoryID = 0;
m_CategoryName = _T("");
m_Description = _T("");
m_nFields = 4;
//}}AFX_FIELD_INIT
m_nDefaultType = snapshot;
}
CString CCategorySet::GetDefaultConnect()
{
//return _T("ODBC;DSN=MyNWind");
return _T("ODBC;DSN=MyNWind;UID=sa;PWD='';");
}
CString CCategorySet::GetDefaultSQL()
{
return _T("[dbo].[Categories]");
}
void CCategorySet::DoFieldExchange(CFieldExchange* pFX)
{
//{{AFX_FIELD_MAP(CCategorySet)
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Long(pFX, _T("[CategoryID]"), m_CategoryID);
RFX_Text(pFX, _T("[CategoryName]"), m_CategoryName);
RFX_Text(pFX, _T("[Description]"), m_Description);
RFX_LongBinary(pFX, _T("[Picture]"), m_Picture);
//}}AFX_FIELD_MAP
}
/////////////////////////////////////////////////////////////////////////////
// CCategorySet diagnostics
#ifdef _DEBUG
void CCategorySet::AssertValid() const
{
CRecordset::AssertValid();
}
void CCategorySet::Dump(CDumpContext& dc) const
{
CRecordset::Dump(dc);
}
#endif //_DEBUG
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -