日期:2014-05-19  浏览次数:20878 次

[VS2005,Office2007]VS中注册Office2007 COM 组件失败
新建了一个WinApp的项目,在工具栏中加入了Office2007   的一些控件,但在使用这些控件的时候发生如下错误

异常类型:
System.Runtime.InteropServices.COMException

异常信息:
没有注册类别   (异常来自   HRESULT:0x80040154   (REGDB_E_CLASSNOTREG))

堆栈信息:
      在   System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid&   clsid,   Object   punkOuter,   Int32   context,   Guid&   iid)
      在   System.Windows.Forms.AxHost.CreateWithoutLicense(Guid   clsid)
      在   System.Windows.Forms.AxHost.CreateWithLicense(String   license,   Guid   clsid)
      在   System.Windows.Forms.AxHost.CreateInstanceCore(Guid   clsid)
      在   System.Windows.Forms.AxHost.CreateInstance()
      在   System.Windows.Forms.AxHost.GetOcxCreate()
      在   System.Windows.Forms.AxHost.TransitionUpTo(Int32   state)
      在   System.Windows.Forms.AxHost.CreateHandle()
      在   System.Windows.Forms.Control.CreateControl(Boolean   fIgnoreVisible)
      在   System.Windows.Forms.Control.CreateControl()
      在   System.Windows.Forms.Control.ControlCollection.Add(Control   value)
      在   System.Windows.Forms.Form.ControlCollection.Add(Control   value)


没找到解决方法


------解决方案--------------------
看看组策略中的Dcom的设置,是否哪里限制了
------解决方案--------------------
1.错误信息
Microsoft OLE DB Provider for ODBC Drivers error '80004005 '
[Microsoft][ODBC Microsoft Access 97 Driver] The Microsoft Jet database
engine cannot open the file '(unknown) '. It is already opened exclusively
by another user, or you need permission to view its data.
原因:
这个错误发生在当IIS使用匿名帐号(通常是IUSR)时,该帐号在NT中对数据库所在的目录
没有正确的权限.(这就是为什么在Win95和PWS下没问题,因为win95根本就没有目录权限这一说)
检查文件和目录的权限. 确定你能够在该目录中有能够新建和删除临时文件的权限。
这些临时文件其实是数据库建立在同一个目录下的文件, 但是要注意的是,有可能这些文件
也可能建立在别的目录,例如 /Winnt.

使用NT的文件监视程序监视文件失败时到底是访问了什么目录。
这个NT的文件监视程序可以在这个地方下载http://www.sysinternals.com.

如果你对数据库使用了一个网络地址,例如映射地址,就要检查一下共享文件和目录的权限,

还要检查一下数据源文件(DSN)是否被别的程序标志成为正在使用中,
这些别的程序一般是Visual InterDev,关闭任何一个InterDev中的正打开和数据库连接的项目。

这个错误还可能发生在这种情况:如果在DSN中使用了一个UNC路径(就是通用命名协议),请改用
本地路径进行测试,因为如果对本地数据库使用UNC也可能出错。
还可能发生在这种情况,如果服务器要访问Access中的一个表,而这个表却联接在一个网络服务器上。

2.错误信息:
Microsoft OLE DB Provider for ODBC Drivers error '80004005 '
[Microsoft][ODBC Microsoft Access 97 Driver] Couldn 't use '(unknown) '; file
already in use.
原因:
多人使用时数据库被锁定。

3.错误信息:
Microsoft OLE DB Provider for ODBC Drivers error '80004005 '
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified.
原因:
最可能的原因是ConnectString是一个在global.asa中初始化的Session变量,但是global.asa
却没有正常工作。解决办法是,检查赋值时是否正确:(在你的asp中加入下面的代码)
<%= " 'auth_user ' is " & request.servervariables( "auth_user ")%>
<P>
<%= " 'auth_type ' is " & request.servervariables( "auth_type ")%>