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

📄 rcconnectserver.cpp

📁 MSSQL备份及恢复的VC++源代码。提供给大家学习。
💻 CPP
字号:
//////////////////////////////////////////////////////////////////////////////
//																			//
//			Created by Ozzy Osbourne(maojun) . HangZhou . 20030214			//
//				 warning: need add sqldmoid.h & sqldmo.h					//
//																			//
//////////////////////////////////////////////////////////////////////////////

// CRcConnectServer could connect mssql server and disconnect mssql server.
// 
// Expect bugs.
// 
// Please use and enjoy. Please let me know of any bugs/mods/improvements 
// that you have found/implemented and I will fix/incorporate them into this file.
// Please send report to OzzyJMalmsteen@yahoo.com.cn or Ozzman@163.net

#include "stdafx.h"
#include "RcMSSQL.h"
#include "RcConnectServer.h"

// DMO headers
#include "..\base\include\sqldmoid.h"
#include "..\base\include\sqldmo.h"

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

LPSQLDMOSERVER g_pSQLServer;

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

CRcConnectServer::CRcConnectServer()
{

}

CRcConnectServer::~CRcConnectServer()
{

}

BOOL CRcConnectServer::InitServer()
{
	HRESULT hr;

	if FAILED(hr = CoInitialize (NULL))
	{
		m_strErrorMessage.Format ("%s", "CoInitialize 失败!");
		return FALSE;
	}

	if FAILED(hr = CoCreateInstance (CLSID_SQLDMOServer, NULL, CLSCTX_INPROC_SERVER, 
	IID_ISQLDMOServer, (LPVOID*)&g_pSQLServer))
	{
		m_strErrorMessage.Format ("%s", "创建 CLSID_SQLDMOServer 实例时失败!");
		return FALSE;
	} 
	return TRUE;
}

BOOL CRcConnectServer::ConnectToServer()
{
	return TRUE;
}

BOOL CRcConnectServer::DisconnectFromServer()
{
	return TRUE;
}

⌨️ 快捷键说明

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