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

📄 historydlg.cpp

📁 银行管理系统,在VisualC++中操作SQL数据库进行银行帐号的创建,删除,修改,转帐,存款,取款,生成密码卡等操作.
💻 CPP
字号:
// HistoryDlg.cpp : 实现文件
//

#include "stdafx.h"
#include "BankSystem.h"
#include "HistoryDlg.h"
#include ".\historydlg.h"


// HistoryDlg 对话框

IMPLEMENT_DYNAMIC(HistoryDlg, CDialog)
HistoryDlg::HistoryDlg(CWnd* pParent /*=NULL*/)
	: CDialog(HistoryDlg::IDD, pParent)
{
}

HistoryDlg::~HistoryDlg()
{
}

void HistoryDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_LIST1, List1);
}


BEGIN_MESSAGE_MAP(HistoryDlg, CDialog)
	ON_BN_CLICKED(IDC_Cancel, OnBnClickedCancel)
	ON_BN_CLICKED(IDC_ListRec, OnBnClickedListrec)
END_MESSAGE_MAP()


// HistoryDlg 消息处理程序

void HistoryDlg::OnBnClickedCancel()
{
	// TODO: 在此添加控件通知处理程序代码
	OnOK();
}


void HistoryDlg::OnBnClickedListrec()
{
	// TODO: 在此添加控件通知处理程序代码
	CString strQuery="SELECT * FROM argue";
	


	try{
		pRst=pConn->Execute(_bstr_t(strQuery),NULL,adCmdText);
	}
	catch(_com_error &e)
	{
		MessageBox(e.ErrorMessage()); 
		return ;
	}

	while(!pRst->rsEOF)//将查询到的数据加到列表框咯。
	{
		CString str=""+(_bstr_t)pRst->GetCollect("uname")+"  "+(_bstr_t)pRst->GetCollect("topic")+"  "+(_bstr_t)pRst->GetCollect("content")+"";
		
		List1.AddString(str);
		pRst->MoveNext();
	}
}

⌨️ 快捷键说明

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