2011年10月31日 星期一

Unable to cast COM object of type (Library not registered)

Access 2003 要轉版Access 2007 發生的錯誤訊息說明:

Exception Session:
Unable to cast  COM object of type 'Microsoft.Office.Interop.Access.Dao.DBEngineClass' to
interface type 'Microsoft.Office.Interop.Access.Dao._DBEngine'. This  operation failed because the QueryInterface call on the COM component for the  interface with IID '{00000021-0000-0010-8000-00AA006D2EA4}' failed due to the  following error: Library not registered. (Exception from HRESULT: 0x8002801D

說明:
這是要從Access 2003 轉換到Access 2007 發生的錯誤,系統告訴我們有一個DAO360.dll的原件沒有被註冊,所以沒辦法進行轉換。DAO360.dll 放在 C:\Program Files\Common Files\microsoft shared\DAO。

註冊元件:
[開始] >>> [CMD] >>> [進入DOS Modle] >> [cd C:\Program Files\Common Files\microsoft shared\DAO] >>> [regsvr32 dao360.dll]

[補充]
1. 如果註冊後也不行的話,請重開機試試。
2. 可先反註冊,在註冊一次。反註冊:regsvr32 -u dao360.dll
3. 都不行的話,你有可能以前註冊過了,試著想一想之前DAO360.dll放在哪裡 (EveryThing這套搜尋軟體很好用)。直接在DOS中切換到該目錄,執行註冊

實例說明:
之前ARS 的DAO360.dll是放在C:\Program Files\Dao360.dll。然後移除ARS,在安裝SRS,這時候系統還是會記住元件是在的路徑在C:\Program Files\中。造成SRS轉版失敗。

不管你用C:\Program Files\Common Files\microsoft shared\DAO這路徑註冊1萬次都不能用。這是重新安裝ARS,元件就會重新註冊回去,SRS也就可以轉版了。

或者把ARS的DAO360.dll元件放回到原本的C:\Program Files\Dao360.dll,重新註冊也可以。

沒有留言: