電腦是64位win8系統
編譯軟體MSDEV3
資料庫軟體access2003 (mdb檔案)
1.嘗試多次修改連接字串 無果
2.下載mdac組件 無果
HRESULT hr;
try
{
hr=m_pConnection.CreateInstance(_uuidof(Connection));
if(SUCCEEDED(hr))
{
m_pConnection->ConnectionString="File Name=data.udl";
hr=m_pConnection->Open("","","",adConnectUnspecified);
if(FAILED(hr))
{
AfxMessageBox("open file!");
return TRUE;
}
}
else
{
AfxMessageBox("createinstance of Connection fail!");
return TRUE;
}
}
catch(_com_error e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
AfxMessageBox(bstrSource+bstrDescription);
return TRUE;
}
InitListCtr();
uj5u.com熱心網友回復:
都Win8了就用vs2015吧,然后ado方式訪問資料庫uj5u.com熱心網友回復:
幾年前的時候, 問這個問題的很多, 那時ADO組件升級了, GUID變了你的代碼用GUID跟系統注冊的GUID不一致, 所以說沒有注冊類
你可以把ADO某個版本復制出來, 然后代碼匯入這個檔案, 這樣GUID就固定是這個版本了
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/113961.html
標籤:數據庫
