}void CMyView::OnButtonok() { // TODO: Add your control notification handler code here UpdateData(); m_pSet->Edit(); m_pSet->m_XJ=m_pSet->m_JG*m_pSet->m_JS; UpdateData(TRUE); }void CMyView::OnUpdateEditxj() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the CRecordView::OnInitDialog() // function to send the EM_SETEVENTMASK message to the control // with the ENM_UPDATE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
{
return _T("ODBC;DSN=商品交易管理数据源");
}还有 m_nDefaultType =dynaset ;
我觉的有用的就这些了啊,如果你要全部的,留下邮箱我发给你啊
//#include "stdafx.h"
#include "商品交易管理系统.h"#include "商品交易管理系统Set.h"
#include "商品交易管理系统Doc.h"
#include "商品交易管理系统View.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CMyViewIMPLEMENT_DYNCREATE(CMyView, CRecordView)BEGIN_MESSAGE_MAP(CMyView, CRecordView)
//{{AFX_MSG_MAP(CMyView)
ON_BN_CLICKED(IDC_BUTTONADDNEW, OnButtonaddnew)
ON_BN_CLICKED(IDC_BUTTONOK, OnButtonok)
ON_EN_UPDATE(IDC_EDITXJ, OnUpdateEditxj)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CRecordView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CRecordView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CRecordView::OnFilePrintPreview)
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CMyView construction/destructionCMyView::CMyView()
: CRecordView(CMyView::IDD)
{
//{{AFX_DATA_INIT(CMyView)
m_pSet = NULL;
//}}AFX_DATA_INIT
// TODO: add construction code here}CMyView::~CMyView()
{
}void CMyView::DoDataExchange(CDataExchange* pDX)
{
CRecordView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyView)
DDX_FieldText(pDX, IDC_EDITJG, m_pSet->m_JG, m_pSet);
DDX_FieldText(pDX, IDC_EDITJS, m_pSet->m_JS, m_pSet);
DDX_FieldText(pDX, IDC_EDITJYRQ, m_pSet->m_JYRQ, m_pSet);
DDX_FieldText(pDX, IDC_EDITSPBH, m_pSet->m_SPBH, m_pSet);
DDX_FieldText(pDX, IDC_EDITSPMC, m_pSet->m_SPMC, m_pSet);
DDX_FieldText(pDX, IDC_EDITXJ, m_pSet->m_XJ, m_pSet);
//}}AFX_DATA_MAP
}BOOL CMyView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs return CRecordView::PreCreateWindow(cs);
}void CMyView::OnInitialUpdate()
{
m_pSet = &GetDocument()->m_mySet;
CRecordView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();}/////////////////////////////////////////////////////////////////////////////
// CMyView printingBOOL CMyView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}void CMyView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}void CMyView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}/////////////////////////////////////////////////////////////////////////////
// CMyView diagnostics#ifdef _DEBUG
void CMyView::AssertValid() const
{
CRecordView::AssertValid();
}void CMyView::Dump(CDumpContext& dc) const
{
CRecordView::Dump(dc);
}CMyDoc* CMyView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMyDoc)));
return (CMyDoc*)m_pDocument;
}
#endif //_DEBUG/////////////////////////////////////////////////////////////////////////////
// CMyView database support
CRecordset* CMyView::OnGetRecordset()
{
return m_pSet;
}
/////////////////////////////////////////////////////////////////////////////
// CMyView message handlersvoid CMyView::OnButtonaddnew()
{
// TODO: Add your control notification handler code here
m_pSet->AddNew();
UpdateData(FALSE);
}void CMyView::OnButtonok()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->Edit();
m_pSet->m_XJ=m_pSet->m_JG*m_pSet->m_JS;
UpdateData(TRUE);
}void CMyView::OnUpdateEditxj()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CRecordView::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_UPDATE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
}
Access数据库如何设置共享,谢谢了
http://dev.csdn.net/develop/article/27/27337.shtm
http://www.vckbase.com/document/viewdoc/?id=438你的基本思路有问题!
//商品交易管理系统View.cpp 中的
void CMyView::OnButtonaddnew()
{
// TODO: Add your control notification handler code here
m_pSet->AddNew();
UpdateData(FALSE);
}void CMyView::OnButtonok()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->Edit();
m_pSet->m_XJ=m_pSet->m_JG*m_pSet->m_JS;
UpdateData(TRUE);
}
这两个函数是自己添加上去的,其他都是自动生成的