vc连接数据库SQL SEVER必须要的那几把斧头
//1.申明引入的库
#import "c:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF") rename("BOF","adoBOF")
using namespace ADODB;
//2.三个智能指针
_ConnectionPtr
_CommandPtr
_RecordsetPtr
//3.数据库连接字符串
"Provider=SQLOLEDB;Data source=(local);Database=student;Uid=;Pwd=;Integrated Security=SSPI"
COM对象初始化 以及释放资源
CoInitialize();
CoUninitialize();