?? mimadlg.cpp
字號:
// MiMaDlg.cpp : implementation file
//
#include "stdafx.h"
#include "廢品收購管理系統.h"
#include "MiMaDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMiMaDlg dialog
CMiMaDlg::CMiMaDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMiMaDlg::IDD, pParent)
{
EnableAutomation();
//{{AFX_DATA_INIT(CMiMaDlg)
m_newmima1 = _T("");
m_newmima2 = _T("");
//}}AFX_DATA_INIT
}
void CMiMaDlg::OnFinalRelease()
{
// When the last reference for an automation object is released
// OnFinalRelease is called. The base class will automatically
// deletes the object. Add additional cleanup required for your
// object before calling the base class.
CDialog::OnFinalRelease();
}
void CMiMaDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMiMaDlg)
DDX_Control(pDX, IDC_EDIT_NEWMIMA2, m_newmima22);
DDX_Control(pDX, IDC_EDIT_NEWMIMA1, m_newmima11);
DDX_Text(pDX, IDC_EDIT_NEWMIMA1, m_newmima1);
DDX_Text(pDX, IDC_EDIT_NEWMIMA2, m_newmima2);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMiMaDlg, CDialog)
//{{AFX_MSG_MAP(CMiMaDlg)
ON_BN_CLICKED(ID_OK, OnOk)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CMiMaDlg, CDialog)
//{{AFX_DISPATCH_MAP(CMiMaDlg)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_IMiMaDlg to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {0C0F5356-BB5B-460B-B082-B81908206FEB}
static const IID IID_IMiMaDlg =
{ 0xc0f5356, 0xbb5b, 0x460b, { 0xb0, 0x82, 0xb8, 0x19, 0x8, 0x20, 0x6f, 0xeb } };
BEGIN_INTERFACE_MAP(CMiMaDlg, CDialog)
INTERFACE_PART(CMiMaDlg, IID_IMiMaDlg, Dispatch)
END_INTERFACE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMiMaDlg message handlers
void CMiMaDlg::OnOk()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
if((m_newmima1=="") || (m_newmima2==""))
{
MessageBox("密碼不能為空!");
m_newmima1="";
m_newmima2="";
m_newmima11.SetFocus();
}
else if(m_newmima1!=m_newmima2)
{
MessageBox("兩次輸入的密碼要一致!");
m_newmima1="";
m_newmima2="";
m_newmima11.SetFocus();
}
else
{
CoInitialize(NULL);
_ConnectionPtr pCon(_uuidof(Connection));
_RecordsetPtr pRec(_uuidof(Recordset));
pCon->ConnectionTimeout=5;
pCon->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=廢品交易數據庫.mdb","","",adModeUnknown);
CString strSQL;
_bstr_t bstrtemp;
strSQL.Format("UPDATE 用戶名與密碼表 SET 密碼='"+m_newmima1+"'");
bstrtemp=strSQL;
pRec=pCon->Execute(bstrtemp,NULL,adCmdText);
MessageBox("修改密碼成功!");
OnOK();
//pRec->Close();
pCon->Close();
pRec.Release();
pCon.Release();
CoUninitialize();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -