database.cpp

来自「PC抄表软件, 用于降数据上载到PC机上, 通过USB传COM口实现.」· C++ 代码 · 共 101 行

CPP
101
字号
// DataBase.cpp : implementation file
//

#include "stdafx.h"
#include "Robin.h"
#include "DataBase.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDataBase

IMPLEMENT_DYNAMIC(CDataBase, CRecordset)

CDataBase::CDataBase(CDatabase* pdb)
	: CRecordset(pdb)
{
	//{{AFX_FIELD_INIT(CDataBase)
	m_strtype = _T("");
	m_strnumber = _T("");
	m_strnumber2 = _T("");

	m_strunits = _T("");
//	m_ixc = 0.0;
	m_ixc = 0;

	m_strsxyyz = _T("");
	m_strsxfjf = _T("");

	m_strsxwxk = _T("");

	m_strsxylf = _T("");
	m_strlrdv = _T("");
	m_strlrdd = _T("");
	m_strcomm = _T("");


	m_nFields = 15;
	//}}AFX_FIELD_INIT
	m_nDefaultType = snapshot;
}


CString CDataBase::GetDefaultConnect()
{
	return _T("ODBC;DSN=CarsDataBase");
}

CString CDataBase::GetDefaultSQL()
{
	return _T("[cars]");
}

void CDataBase::DoFieldExchange(CFieldExchange* pFX)
{
	//{{AFX_FIELD_MAP(CDataBase)
	pFX->SetFieldType(CFieldExchange::outputColumn);
	RFX_Text(pFX, _T("[strtype]"), m_strtype);
	RFX_Text(pFX, _T("[strnumber]"), m_strnumber);
	RFX_Text(pFX, _T("[strnumber2]"), m_strnumber2);

	RFX_Text(pFX, _T("[strunits]"), m_strunits);
//	RFX_Double(pFX, _T("[ixc]"), m_ixc);
	RFX_Int(pFX, _T("[ixc]"), m_ixc);

	RFX_Text(pFX, _T("[strsxyyz]"), m_strsxyyz);
	RFX_Text(pFX, _T("[strsxfjf]"), m_strsxfjf);

	RFX_Text(pFX, _T("[strlrdv]"), m_strlrdv);
	RFX_Text(pFX, _T("[strlrdd]"), m_strlrdd);
	RFX_Text(pFX, _T("[strcomm]"), m_strcomm);

	RFX_Text(pFX, _T("[strsxwxk]"), m_strsxwxk);

	RFX_Text(pFX, _T("[strsxylf]"), m_strsxylf);

	RFX_Text(pFX, _T("[trkdate]"), m_trkdate);
	RFX_Text(pFX, _T("[tccdate]"), m_tccdate);
	RFX_Text(pFX, _T("[tcctime]"), m_tcctime);
	//}}AFX_FIELD_MAP
}

/////////////////////////////////////////////////////////////////////////////
// CDataBase diagnostics

#ifdef _DEBUG
void CDataBase::AssertValid() const
{
	CRecordset::AssertValid();
}

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

⌨️ 快捷键说明

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