里面介绍了,com,动态链接库,钩子应用,网络通信等
// 创建ADO的数据库连接和记录集对象
HRESULT hr;
_bstr_t strConn("Provider=SQLOLEDB.1;Password=begin_sa;"
"Persist Security Info=True;User ID=sa;"
"Initial Catalog=Students;Data Source=GXP");
try
{
hr = m_pConnection.CreateInstance(_uuidof(Connection));
if(SUCCEEDED(hr))
{
m_pConnection->CursorLocation = adUseServer;
hr = m_pConnection->Open(strConn, "", "", adConnectUnspecified);
}
if(SUCCEEDED(hr))
{
hr = m_pRecordset.CreateInstance(_uuidof(Recordset));
}
if(SUCCEEDED(hr))
{
m_blnConnected = TRUE;
}
评论