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

📄 dialogupdata.cpp

📁 vc++ 利用ADO访问MYSQL数据
💻 CPP
字号:
// DialogUpdata.cpp : implementation file
//

#include "stdafx.h"
#include "Student.h"
#include "DialogUpdata.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDialogUpdata dialog


CDialogUpdata::CDialogUpdata(CWnd* pParent /*=NULL*/)
	: CDialog(CDialogUpdata::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDialogUpdata)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CDialogUpdata::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDialogUpdata)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDialogUpdata, CDialog)
	//{{AFX_MSG_MAP(CDialogUpdata)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDialogUpdata message handlers

void CDialogUpdata::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData(TRUE);
	CString strupnum,strupchinese,strupmaths,strupenglish,strupphyics,strupchemistry;
	GetDlgItemText(IDC_EDIT_UPNUM,strupnum);
    GetDlgItemText(IDC_EDIT_UPMATH,strupmaths);
	GetDlgItemText(IDC_EDIT_UPCHINESE,strupchinese);
	GetDlgItemText(IDC_EDIT_UPCHEMISTRY,strupchemistry);
	GetDlgItemText(IDC_EDIT_UPENGLISH,strupenglish);
	GetDlgItemText(IDC_EDIT_UPPHYSIC,strupphyics);
	SetDlgItemText(IDC_EDIT_UPCHINESE,_T(""));
    SetDlgItemText(IDC_EDIT_UPMATH,_T(""));
	SetDlgItemText(IDC_EDIT_UPENGLISH,_T(""));
	SetDlgItemText(IDC_EDIT_UPCHEMISTRY,_T(""));
	SetDlgItemText(IDC_EDIT_UPPHYSIC,_T(""));
	if (strupnum.GetLength()==0)
	{
		MessageBox("请添加学生的学号!");
		return;
	}
	CString sql;
	sql.Format("update student set STU_CHINESE='%s',STU_MATHS='%s',STU_ENGLISH='%s',STU_PHYSICS='%s',STU_CHEMISTRY='%s' where STU_NUM='%s' ",
		strupchinese,strupmaths,strupenglish,strupphyics,strupchemistry,strupnum);
	theApp.m_ado.ExeNoneQureSql(sql);
//	CDialog::OnOK();
}

void CDialogUpdata::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
}

⌨️ 快捷键说明

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