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

📄 customerset.cpp

📁 Beginning Visual C++ 6源码。Wrox。
💻 CPP
字号:
// CustomerSet.cpp : implementation file
//

#include "stdafx.h"
#include "DBSample.h"
#include "CustomerSet.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCustomerSet

IMPLEMENT_DYNAMIC(CCustomerSet, CRecordset)

CCustomerSet::CCustomerSet(CDatabase* pdb)
	: CRecordset(pdb)
{
	//{{AFX_FIELD_INIT(CCustomerSet)
	m_CustomerID = _T("");
	m_CompanyName = _T("");
	m_ContactName = _T("");
	m_ContactTitle = _T("");
	m_Address = _T("");
	m_City = _T("");
	m_Region = _T("");
	m_PostalCode = _T("");
	m_Country = _T("");
	m_Phone = _T("");
	m_Fax = _T("");
	m_nFields = 11;
	//}}AFX_FIELD_INIT
	m_CustomerIDparam = _T("");     // Initial customer ID parameter
   m_nParams = 1;                  // Number of parameters

	m_nDefaultType = snapshot;
}


CString CCustomerSet::GetDefaultConnect()
{
	return _T("ODBC;DSN=Sample Data");
}

CString CCustomerSet::GetDefaultSQL()
{
	return _T("[Customers]");
}

void CCustomerSet::DoFieldExchange(CFieldExchange* pFX)
{
	//{{AFX_FIELD_MAP(CCustomerSet)
	pFX->SetFieldType(CFieldExchange::outputColumn);
	RFX_Text(pFX, _T("[CustomerID]"), m_CustomerID);
	RFX_Text(pFX, _T("[CompanyName]"), m_CompanyName);
	RFX_Text(pFX, _T("[ContactName]"), m_ContactName);
	RFX_Text(pFX, _T("[ContactTitle]"), m_ContactTitle);
	RFX_Text(pFX, _T("[Address]"), m_Address);
	RFX_Text(pFX, _T("[City]"), m_City);
	RFX_Text(pFX, _T("[Region]"), m_Region);
	RFX_Text(pFX, _T("[PostalCode]"), m_PostalCode);
	RFX_Text(pFX, _T("[Country]"), m_Country);
	RFX_Text(pFX, _T("[Phone]"), m_Phone);
	RFX_Text(pFX, _T("[Fax]"), m_Fax);
	//}}AFX_FIELD_MAP
	pFX->SetFieldType(CFieldExchange::param);     // Set parameter mode
    RFX_Text(pFX, _T("CustomerIDParam"), m_CustomerIDparam);

}

/////////////////////////////////////////////////////////////////////////////
// CCustomerSet diagnostics

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

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

⌨️ 快捷键说明

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