SQL1159 DB2 .NET 数据提供程序初始化错误,原因代码 7,标记 9.5.0.DEF.2,SOFTWARE\IBM\DB2\InstalledCopies
我正在尝试从 32 位 .Net 应用程序获取 DB2 数据提供程序,以连接到在 Vista 64 上作为 32 位应用程序运行的 DB2(这是否足够令人困惑)? 不幸的是,我收到以下错误:
SQL1159 DB2 .NET 数据提供程序初始化错误,原因代码 7,标记 9.5.0.DEF.2,SOFTWARE\IBM\DB2\InstalledCopies
有几个 IBM 论坛帖子 提到了它,但几乎没有有用的指导。 有谁之前经历过这个吗? 或者您有更好的解决办法吗?
I am trying to get the DB2 data provider from a 32-bit .Net application to connect to DB2 running as a 32-bit application on Vista 64 (is that confusing enough yet)? Unfortunately, I am getting the following error:
SQL1159 Initialization error with DB2 .NET Data Provider, reason code 7, tokens 9.5.0.DEF.2, SOFTWARE\IBM\DB2\InstalledCopies
There are several IBM forum posts mentioning it, but little useful guidance. Has anyone experienced this before? Or do you have better ideas for fixing it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
是的。 这应该发生在 Windows 7 中,而不是 Windows XP 中。 灵魂是:
Yes. This should happen in you windows 7 and not in windows xp. The soultion is :
我也有类似的问题,我的机器是64位的。 我安装了 32 位和 64 位 db2 运行时客户端,在我的项目中将目标框架设置为 32 位,这对我来说非常适合。 我能够在其他 64/32 位机器上运行该应用程序,只是他们需要从 db2 运行时客户端安装 32 位或 64 位,具体取决于机器操作系统。
I had similar issue, my machine is 64 bit. I installed both 32bit and 64 bit db2 run time clients, set the target framework to 32 bit in my project, worked perfectly for me. I was able to run the application on other 64/32 bit machines, just they need to install either the 32bit or the 64 bit from the db2 run time client, depending on the machine OS.
安装 DB2 Express-C for win x64,版本 9.7.1
它会起作用
Install DB2 Express-C for win x64, version 9.7.1
and it would work
我在使用 DB2 .net 提供程序时遇到了同样的问题。
如果您有 Windows 64 位,则下载并安装
IBM 数据服务器运行时客户端 (Windows AMD 64) 版本 9.5
从
_https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_US&source=swg-idsrc11&S_TACT=appddnet&S_CMP=ibm_im
如果运行程序,您将收到以下异常
未处理的异常:System.Overflow 异常:算术
操作导致溢出。
在IBM.Data.DB2.DB2ConnPool.Open(DB2Connection连接,
StringszConnectionStringIn、DB2ConnSettings& ppSettings、对象&
ppConn)
在 IBM.Data.DB2.DB2Connection.Open()
下载并安装适合您的 db2 版本的修复程序
http://www-01.ibm.com/support/docview。 wss?uid=swg1IZ09579
这可以解决问题。
I had the same problem with DB2 .net provider.
If you have windows 64 bit then download and install
IBM Data Server Runtime Client (Windows AMD 64) Version 9.5
from
_https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_US&source=swg-idsrc11&S_TACT=appddnet&S_CMP=ibm_im
If you run your program you would get the following exception
Unhandled Exception: System.Overflow Exception: Arithmetic
operation resulted in an overflow.
at IBM.Data.DB2.DB2ConnPool.Open(DB2Connection connection,
StringszConnectionStringIn, DB2ConnSettings& ppSettings, Object&
ppConn)
at IBM.Data.DB2.DB2Connection.Open()
Download and install the fix for your db2 version from
http://www-01.ibm.com/support/docview.wss?uid=swg1IZ09579
this would fix the problem.
只是作为一个快速注释...
@Micheal:您为 SQL1159 提供的链接是版本 9.1 文档
版本 9.5 文档上升到原因代码 9
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.messages.sql.doc/doc/msql01159n.html
不幸的是,我认为有是第 10 个原因代码,该代码未记录在其中,但它位于developerWorks 主题中
http:// www.ibm.com/developerworks/wikis/display/DB2/DB2+and+.NET+FAQ#DB2and.NETFAQ-WhatisSQL1159InitializationError%3F
Just as a quick note...
@Micheal: the link you had for SQL1159 is to the Version 9.1 docs
The Version 9.5 documentation goes up to reason code 9
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.messages.sql.doc/doc/msql01159n.html
Unfortunately, I think there is a 10th reason code that is undocumented there but it is in a developerWorks topic
http://www.ibm.com/developerworks/wikis/display/DB2/DB2+and+.NET+FAQ#DB2and.NETFAQ-WhatisSQL1159InitializationError%3F
我在 Windows 2003 x86 服务器上也遇到了这个错误。 本来我的问题是
这导致评论说 c:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config 缺少 DbProviderFactories 部分的必要条目。 事实上,那里没有 IBM DB2 条目。 当我手动添加条目时,我遇到了您的这个错误,这表明除了编辑 machine.config 之外还有更多内容。
最后,我卸载了 IBM DB2 驱动程序集,重新启动系统,重新安装它,并使其正确初始化连接。
I encountered this error on a Windows 2003 x86 server as well. Originally my problem was
which led to comments that c:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config was missing the necessary entries for the DbProviderFactories section. And indeed, there were no IBM DB2 entries there. When I manually added in an entry, I then encountered this error of yours, suggesting that there is more than just editing machine.config.
Evenutally I uninstalled the IBM DB2 driver set, reboot the system, reinstalled it, and got it initializing connections properly.
我卸载了以前的 32 位版本,重新安装为 64 位,现在我得到了完全不同的错误。 它提到需要 FP2 来修复,但由于我使用的是 Express-C,所以我无法安装修复包(IBM 不为免费的 DB2 产品提供修复包)。 不管怎样,谢谢你的帮助。 至少我现在可以更接近连接了。 :)
I uninstalled the previous 32bit version, reinstalled as 64bit, and now I get a completely different error. Its mentioned as requiring FP2 to fix, but since I'm using Express-C, I can't install the fixpack (IBM doesn't provide fixpacks for free DB2 products). Anyway, thanks for the help. At least I can come closer to connecting now. :)
我假设您已经看过 SQL1159 在 DB2 参考指南?
不幸的是,原因代码停在 6 处,不会继续到 7。它确实说:
所以我想尝试重新安装它,如果问题仍然存在,您必须联系 IBM。
抱歉,我知道这没有多大帮助。
I assume you have seen the writeup of SQL1159 in the DB2 Reference Guide?
Unfortunately for you, the reason codes stop at 6 and don't continue to 7. It does say:
So I guess try to reinstall it and if the problem continues you'll have to contact IBM.
Sorry, I know that's not much help.
您需要让它作为 x86 运行吗? 我在 Visual Studio 的开发 Web 服务器(x86)下的 Web 应用程序遇到了类似的问题,但切换到 IIS (x64) 对我来说很有效。 由于我正在部署到 IIS x64,所以我就到此为止了。
我尝试使用 Filemon 和 Regmon 进行跟踪,但没有收到任何拒绝或丢失密钥错误。 如果我再看一遍,我会检查 HKLM\Software\WOW6432Node,猜测安装程序会写入 x64 HKLM\Software 节点,而不是 x86 节点。
Are you required to have it run as x86? I had similar issues with web apps under Visual Studio's dev web server (which is x86), but switching over to IIS (x64) worked for me. Since I was deploying to IIS x64, I called it a day at that point.
I tried tracing with Filemon and Regmon, but didn't get any denied or missing keys errors. If I were to look again, I'd check HKLM\Software\WOW6432Node, guessing that the installer writes to the x64 HKLM\Software node, but not the x86 one.
我依稀记得当尝试设置从 sql 2005 到 as/400 的链接服务器时,DB2 for as/400 oledb 驱动程序也有类似的问题。 这是一个权限问题,我最终发现只有 sql server 帐户(不是 Windows)可以使用链接服务器,因为(我认为)驱动程序是使用 sql 的凭据而不是模拟的凭据加载的。 如果它在“以管理员身份运行”时有效,那么它必须是权限。
I vaguely remember having a similar sounding problem with the DB2 for as/400 oledb driver when trying to set up a linked server from sql 2005 to the as/400. It was a permissions issue and I eventually found that only sql server accounts (not windows) could use the linked server because (i think) then the driver was loading using the credentials of the sql instead of impersonated ones. If it works when "run as" admin then it gotta be permissions.