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

📄 tconstr.cpp

📁 如何调用系统数据库联接的对话框
💻 CPP
字号:
// tConStr.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "stdio.h"
#undef EOF
#import "c:\program files\common files\system\ole db\oledb32.dll" rename_namespace("dlinks")
#import "c:\program files\common files\system\ado\msado15.dll" rename_namespace("ado")

void TestConnection(void);



int _tmain(int argc, _TCHAR* argv[])
{

    TestConnection();

	return 0;
}

void TestConnection(void)
{
    using namespace dlinks;
	using namespace ado;
	
	HRESULT hr;
   	::CoInitialize( NULL );
   	IDataSourceLocatorPtr dlPrompt = NULL;
   	_ConnectionPtr conn = NULL;
   	hr = dlPrompt.CreateInstance(__uuidof(DataLinks));
   	conn = dlPrompt->PromptNew();
   	if ( NULL != conn )
   	{
   		printf( "Connect: %s\n", (char*) conn->ConnectionString );
   	}
   
	return;

}

⌨️ 快捷键说明

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