HRESULT hr;
try
{ hr=m_pConnection.CreateInstance(__uuidof(ADODB::Connection));
if(SUCCEEDED(hr)) {
m_pConnection->ConnectionString="File Name=my_data2.udl";
hr=m_pConnection->Open("","","",NULL); if(FAILED(hr))
{
AfxMessageBox("打开错误");
return TRUE; }
}
else
{
AfxMessageBox("创造连接错误");
return TRUE;
}
}
catch(_com_error e)
{ _bstr_t bstrSourse(e.Source());
_bstr_t bstrDescription(e.Description());
AfxMessageBox(bstrSourse+bstrDescription);
return true;
}
try
{ hr=m_pConnection.CreateInstance(__uuidof(ADODB::Connection));
if(SUCCEEDED(hr)) {
m_pConnection->ConnectionString="File Name=my_data2.udl";
hr=m_pConnection->Open("","","",NULL); if(FAILED(hr))
{
AfxMessageBox("打开错误");
return TRUE; }
}
else
{
AfxMessageBox("创造连接错误");
return TRUE;
}
}
catch(_com_error e)
{ _bstr_t bstrSourse(e.Source());
_bstr_t bstrDescription(e.Description());
AfxMessageBox(bstrSourse+bstrDescription);
return true;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货