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

📄 dateservice.cpp

📁 MH编码是用于黑白二进制文件传真的数据压缩。文件传真是指一般文件、图纸、手写稿、表格、报纸等文件的传真。他们是黑白二值的
💻 CPP
字号:
// DateService.cpp: implementation of the CDateService class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "MZ.h"
#include "DateService.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CDateService::CDateService()
{

}

CDateService::~CDateService()
{

}


void CDateService::InitAccess()
{
     CoInitialize(NULL);//初始化COM对象
	//创建记录集对象和连接对象
	m_pConnection.CreateInstance(__uuidof(Connection));
	m_pRecordset.CreateInstance(__uuidof(Recordset));
}

void CDateService::exitAccess()
{
   	//关闭记录集
	m_pRecordset->Close();
	m_pRecordset.Release();
	//关闭数据库连接
	m_pConnection->Close();
	m_pConnection.Release();
	CoUninitialize();
}

void CDateService::openAccess(_bstr_t Data, CString form)
{
    CString bstrSQL="Select *From "+form+"";
	m_pConnection->ConnectionString="uid=;pwd=;DRIVER={Microsoft Access Driver (*.mdb)};DBQ="+Data+";";
    m_pConnection->Open(L"",L"",L"",adCmdUnspecified);
	//打开数据库指定表	
	m_pRecordset->Open(_variant_t(bstrSQL.GetBuffer(bstrSQL.GetLength())),_variant_t(m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText);
}

⌨️ 快捷键说明

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