?? rcconnectserver.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 + -