?? avgset.cpp
字號:
// AVGSet.cpp : implementation file
//
#include "stdafx.h"
#include "mydb.h"
#include "AVGSet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAVGSet
IMPLEMENT_DYNAMIC(CAVGSet, CRecordset)
CAVGSet::CAVGSet(CDatabase* pdb)
: CRecordset(pdb)
{
//{{AFX_FIELD_INIT(CAVGSet)
//m_AVGSalary = _T("");
m_AVGSalary = 0.0;
//}}AFX_FIELD_INIT
//m_Salary = _T("");
m_nFields = 1;
m_nDefaultType = snapshot;
}
CString CAVGSet::GetDefaultConnect()
{
return _T("ODBC;DSN=guyuan");
}
CString CAVGSet::GetDefaultSQL()
{
return "Employee,Department";
}
void CAVGSet::DoFieldExchange(CFieldExchange* pFX)
{
//{{AFX_FIELD_MAP(CAVGSet)
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Double(pFX,"AVG(Salary)",m_AVGSalary);
//RFX_Text(pFX, _T("[Salary]"), m_Salary);
//}}AFX_FIELD_MAP
}
/////////////////////////////////////////////////////////////////////////////
// CAVGSet diagnostics
#ifdef _DEBUG
void CAVGSet::AssertValid() const
{
CRecordset::AssertValid();
}
void CAVGSet::Dump(CDumpContext& dc) const
{
CRecordset::Dump(dc);
}
#endif //_DEBUG
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -