📄 querydlg.cpp
字号:
// QueryDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "BankSystem.h"
#include "QueryDlg.h"
#include ".\querydlg.h"
// QueryDlg 对话框
IMPLEMENT_DYNAMIC(QueryDlg, CDialog)
QueryDlg::QueryDlg(CWnd* pParent /*=NULL*/)
: CDialog(QueryDlg::IDD, pParent)
, QueryStr(_T(""))
{
}
QueryDlg::~QueryDlg()
{
}
void QueryDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_QueryInput, QueryStr);
DDX_Control(pDX, IDC_LIST1, List2);
}
BEGIN_MESSAGE_MAP(QueryDlg, CDialog)
ON_BN_CLICKED(IDC_Cancel, OnBnClickedCancel)
ON_BN_CLICKED(IDC_Query, OnBnClickedQuery)
END_MESSAGE_MAP()
// QueryDlg 消息处理程序
void QueryDlg::OnBnClickedCancel()
{
// TODO: 在此添加控件通知处理程序代码
OnOK();
}
void QueryDlg::OnBnClickedQuery()
{
// TODO: 在此添加控件通知处理程序代码
UpdateData();
CString str="SELECT * FROM argue WHERE topic=\'"+QueryStr+"\'";
try{
pRst=pConn->Execute(_bstr_t(str),NULL,adCmdText);
}
catch(_com_error &e)
{
MessageBox(e.ErrorMessage());
return ;
}
while(!pRst->rsEOF)//将查询到的数据加到列表框咯。
{
CString str2=" "+(_bstr_t)pRst->GetCollect("content")+" ";
List2.AddString(str2);
pRst->MoveNext();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -