DateBaseSet.cpp
上传用户:z_mail1980
上传日期:2007-06-01
资源大小:647k
文件大小:2k
- // DateBaseSet.cpp : implementation of the CDateBaseSet class
- //
- #include "stdafx.h"
- #include "DateBase.h"
- #include "DateBaseSet.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CDateBaseSet implementation
- IMPLEMENT_DYNAMIC(CDateBaseSet, CRecordset)
- CDateBaseSet::CDateBaseSet(CDatabase* pdb)
- : CRecordset(pdb)
- {
- //{{AFX_FIELD_INIT(CDateBaseSet)
- m_AddressID = 0;
- m_First_Name = _T("");
- m_Last_Name = _T("");
- m_Address = _T("");
- m_City_county = _T("");
- m_Province = _T("");
- m_Zip = _T("");
- m_Country = _T("");
- m_E_mail = _T("");
- m_HomePhone = _T("");
- m_WorkPhone = _T("");
- m_Fax = _T("");
- // m_Birthday = 0;
- m_PostalCard = FALSE;
- m_SpouseName = _T("");
- m_Notes = _T("");
- m_nFields = 17;
- //}}AFX_FIELD_INIT
- m_nDefaultType = snapshot;
- }
- CString CDateBaseSet::GetDefaultConnect()
- {
- return _T("ODBC;DSN=TYVCDB_KQF");
- }
- CString CDateBaseSet::GetDefaultSQL()
- {
- return _T("[Address]");
- }
- void CDateBaseSet::DoFieldExchange(CFieldExchange* pFX)
- {
- //{{AFX_FIELD_MAP(CDateBaseSet)
- pFX->SetFieldType(CFieldExchange::outputColumn);
- RFX_Long(pFX, _T("[AddressID]"), m_AddressID);
- RFX_Text(pFX, _T("[First Name]"), m_First_Name);
- RFX_Text(pFX, _T("[Last Name]"), m_Last_Name);
- RFX_Text(pFX, _T("[Address]"), m_Address);
- RFX_Text(pFX, _T("[City/county]"), m_City_county);
- RFX_Text(pFX, _T("[Province]"), m_Province);
- RFX_Text(pFX, _T("[Zip]"), m_Zip);
- RFX_Text(pFX, _T("[Country]"), m_Country);
- RFX_Text(pFX, _T("[E_mail]"), m_E_mail);
- RFX_Text(pFX, _T("[HomePhone]"), m_HomePhone);
- RFX_Text(pFX, _T("[WorkPhone]"), m_WorkPhone);
- RFX_Text(pFX, _T("[Fax]"), m_Fax);
- RFX_Date(pFX, _T("[Birthday]"), m_Birthday);
- RFX_Bool(pFX, _T("[PostalCard]"), m_PostalCard);
- RFX_Text(pFX, _T("[SpouseName]"), m_SpouseName);
- RFX_Text(pFX, _T("[Notes]"), m_Notes);
- RFX_LongBinary(pFX, _T("[照片]"), m_column1);
- //}}AFX_FIELD_MAP
- }
- /////////////////////////////////////////////////////////////////////////////
- // CDateBaseSet diagnostics
- #ifdef _DEBUG
- void CDateBaseSet::AssertValid() const
- {
- CRecordset::AssertValid();
- }
- void CDateBaseSet::Dump(CDumpContext& dc) const
- {
- CRecordset::Dump(dc);
- }
- #endif //_DEBUG
- long CDateBaseSet::GetMaxID()
- {
- MoveLast();
- return m_AddressID;
- }