📄 tconstr.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 + -