⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usermanage.cpp

📁 Visual C++数据库编程源代码 《Visual C++程序员成长攻略》一书的附带源代码
💻 CPP
字号:
// UserManage.cpp : implementation file
//

#include "stdafx.h"
#include "DAO_EXAMPLE2.h"
#include "UserManage.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CUserManage

IMPLEMENT_DYNAMIC(CUserManage, CDaoRecordset)

CUserManage::CUserManage(CDaoDatabase* pdb)
	: CDaoRecordset(pdb)
{
	//{{AFX_FIELD_INIT(CUserManage)
	m_user = _T("");
	m_password = _T("");
	m_nFields = 2;
	//}}AFX_FIELD_INIT
	m_nDefaultType = dbOpenDynaset;
}


CString CUserManage::GetDefaultDBName()
{
	//Add code
	CString m_path;
	char path[80];
	::GetCurrentDirectory(50,path);       //返回当前路径
	m_path=_T(path);
	m_path+="\\DAO.mdb";                  //产生相对路径
	return  m_path;
}

CString CUserManage::GetDefaultSQL()
{
	return _T("[LOGIN]");
}

void CUserManage::DoFieldExchange(CDaoFieldExchange* pFX)
{
	//{{AFX_FIELD_MAP(CUserManage)
	pFX->SetFieldType(CDaoFieldExchange::outputColumn);
	DFX_Text(pFX, _T("[user]"), m_user);
	DFX_Text(pFX, _T("[passward]"), m_password);
	//}}AFX_FIELD_MAP
}

/////////////////////////////////////////////////////////////////////////////
// CUserManage diagnostics

#ifdef _DEBUG
void CUserManage::AssertValid() const
{
	CDaoRecordset::AssertValid();
}

void CUserManage::Dump(CDumpContext& dc) const
{
	CDaoRecordset::Dump(dc);
}
#endif //_DEBUG

void CUserManage::Open(int nOpenType, LPCTSTR lpszSql, int nOptions) 
{
	// TODO: Add your specialized code here and/or call the base class
	
	CDaoRecordset::Open(nOpenType, lpszSql, nOptions);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -