📄 confirmstationinfodeldlg.cpp
字号:
// ConfirmStationInfoDelDlg.cpp : implementation file
//
#include "stdafx.h"
#include "PROJECTPMU.h"
#include "ConfirmStationInfoDelDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CConfirmStationInfoDelDlg dialog
CConfirmStationInfoDelDlg::CConfirmStationInfoDelDlg(CWnd* pParent /*=NULL*/)
: CDialog(CConfirmStationInfoDelDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CConfirmStationInfoDelDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CConfirmStationInfoDelDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CConfirmStationInfoDelDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CConfirmStationInfoDelDlg, CDialog)
//{{AFX_MSG_MAP(CConfirmStationInfoDelDlg)
ON_BN_CLICKED(IDC_BUTTON1, OnCOnfirmButton)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CConfirmStationInfoDelDlg message handlers
BOOL CConfirmStationInfoDelDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CAdoRecordSet pRS;
if(NULL != GetModuleFileName(NULL,mDir_Path,256))
{
int n=strlen(mDir_Path);
for (int i=n; i>=0; i--)
{
if (mDir_Path[i] == '\\')
{
mDir_Path[i] = '\0';
break;
}
}
strcpy(mMDB_Path,mDir_Path);
strcat(mMDB_Path,"\\PIS.mdb"); // 数据库路径
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CConfirmStationInfoDelDlg::OnCOnfirmButton()
{
// TODO: Add your control notification handler code here
CString str1,str2,sqldelete;
str1=StationNameEn;
str2=StationNameCh;
// AfxMessageBox(StationNameEn);
str1.TrimLeft();
str1.TrimRight();
str2.TrimLeft();
str2.TrimRight();
if(m_pConnection.ConnectAccess(mMDB_Path,"sri"))
sqldelete.Format("delete from StationInfo where (StationNameEn='%s') and (StationNameCh='%s')",str1,str2);
// AfxMessageBox(sqldelete);
m_pConnection.Execute(sqldelete);
Sleep(500);//延时,等数据库更改后再执行下面语句
CConfirmStationInfoDelDlg::OnOK();//将修改后的数据保存到上一个窗体中的控件中
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -