📄 studentinformation.cpp
字号:
// StudentInformation.cpp : implementation file
//
#include "stdafx.h"
#include "DAO_EXAMPLE2.h"
#include "StudentInformation.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CStudentInformation
IMPLEMENT_DYNAMIC(CStudentInformation, CDaoRecordset)
CStudentInformation::CStudentInformation(CDaoDatabase* pdb)
: CDaoRecordset(pdb)
{
//{{AFX_FIELD_INIT(CStudentInformation)
m_name = _T("");
m_englishscore = _T("");
m_mathscore = _T("");
m_chinesescore = _T("");
m_historyscore = _T("");
m_politicalscore = _T("");
m_averagescore = _T("");
m_nFields = 7;
//}}AFX_FIELD_INIT
m_nDefaultType = dbOpenDynaset;
}
CString CStudentInformation::GetDefaultDBName()
{
//"加入自定义代码"
CString m_path;
char path[80];
::GetCurrentDirectory(50,path); //返回当前路径
m_path=_T(path);
m_path+="\\DAO.mdb"; //产生相对路径
return m_path;
}
CString CStudentInformation::GetDefaultSQL()
{
return _T("[STUDENT]");
}
void CStudentInformation::DoFieldExchange(CDaoFieldExchange* pFX)
{
//{{AFX_FIELD_MAP(CStudentInformation)
pFX->SetFieldType(CDaoFieldExchange::outputColumn);
DFX_Text(pFX, _T("[学生姓名]"), m_name);
DFX_Text(pFX, _T("[英语成绩]"), m_englishscore);
DFX_Text(pFX, _T("[数学成绩]"), m_mathscore);
DFX_Text(pFX, _T("[语文成绩]"), m_chinesescore);
DFX_Text(pFX, _T("[历史成绩]"), m_historyscore);
DFX_Text(pFX, _T("[政治成绩]"), m_politicalscore);
DFX_Text(pFX, _T("[平均成绩]"), m_averagescore);
//}}AFX_FIELD_MAP
}
/////////////////////////////////////////////////////////////////////////////
// CStudentInformation diagnostics
#ifdef _DEBUG
void CStudentInformation::AssertValid() const
{
CDaoRecordset::AssertValid();
}
void CStudentInformation::Dump(CDumpContext& dc) const
{
CDaoRecordset::Dump(dc);
}
#endif //_DEBUG
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -