"> " />
欢迎来到天天文库
浏览记录
ID:34762711
大小:160.68 KB
页数:14页
时间:2019-03-10
《将sql数据库中的数据读到access和excel里》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、//CDAccessDlg.cpp:实现文件#include"stdafx.h"#include"CDAccess.h"#include"CDAccessDlg.h"#include"DbSqlite.h"#include#include#include#include#ifdef_DEBUG#definenewDEBUG_NEW#endif//导入COM口#import"C:ProgramFilesCommonFilesSystemadomsadox.dll"#import"C:ProgramFi
2、les/CommonFiles/System/ado/msado15.dll"rename("EOF","adoEOF")//生成C++类,改变EOF函数的名称usingnamespaceADODB;//用于应用程序“关于”菜单项的CAboutDlg对话框classCAboutDlg:publicCDialog{public:CAboutDlg();//对话框数据enum{IDD=IDD_ABOUTBOX};protected:virtualvoidDoDataExchange(CDataExchange*pDX);//DDX/DDV支持//实现protected:DECLARE_ME
3、SSAGE_MAP()};CAboutDlg::CAboutDlg():CDialog(CAboutDlg::IDD){}voidCAboutDlg::DoDataExchange(CDataExchange*pDX){CDialog::DoDataExchange(pDX);//DDX_Control(pDX,IDC_LIST1,m_listRw);}BEGIN_MESSAGE_MAP(CAboutDlg,CDialog)END_MESSAGE_MAP()//CCDAccessDlg对话框CCDAccessDlg::CCDAccessDlg(CWnd*pParent/*=NULL*/
4、):CDialog(CCDAccessDlg::IDD,pParent){m_hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME);m_pDBOpera=newCSqliteConn;}voidCCDAccessDlg::DoDataExchange(CDataExchange*pDX){CDialog::DoDataExchange(pDX);DDX_Control(pDX,IDC_LIST1,m_listResult);}BEGIN_MESSAGE_MAP(CCDAccessDlg,CDialog)ON_WM_SYSCOMMAND()ON_WM_PA
5、INT()ON_WM_QUERYDRAGICON()//}}AFX_MSG_MAPON_BN_CLICKED(IDOK,&CCDAccessDlg::OnBnClickedOk)ON_BN_CLICKED(IDC_SQL,&CCDAccessDlg::OnBnClickedSql)ON_BN_CLICKED(IDC_ACCESS_CREATE,&CCDAccessDlg::OnBnClickedAccessCreate)ON_BN_CLICKED(IDC_COPY,&CCDAccessDlg::OnBnClickedCopy)ON_CBN_SELCHANGE(IDC_COMBO_DEP
6、T,&CCDAccessDlg::OnCbnSelchangeComboDept)//ON_BN_CLICKED(IDC_BUTTON1,&CCDAccessDlg::OnBnClickedButton1)ON_BN_CLICKED(IDC_COPY_EXCEL,&CCDAccessDlg::OnBnClickedCopyExcel)END_MESSAGE_MAP()//CCDAccessDlg消息处理程序BOOLCCDAccessDlg::OnInitDialog(){CDialog::OnInitDialog();//将“关于...”菜单项添加到系统菜单中。//IDM_ABOUTB
7、OX必须在系统命令范围内。ASSERT((IDM_ABOUTBOX&0xFFF0)==IDM_ABOUTBOX);ASSERT(IDM_ABOUTBOX<0xF000);CMenu*pSysMenu=GetSystemMenu(FALSE);if(pSysMenu!=NULL){BOOLbNameValid;CStringstrAboutMenu;bNameValid=strAboutMenu.LoadString(IDS_ABOUTBOX);
此文档下载收益归作者所有