SQL1159 DB2 .NET 数据提供程序初始化错误,原因代码 7,标记 9.5.0.DEF.2,SOFTWARE\IBM\DB2\InstalledCopies

发布于 2024-07-04 14:15:43 字数 424 浏览 17 评论 0原文

我正在尝试从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

缱倦旧时光 2024-07-11 14:15:43

是的。 这应该发生在 Windows 7 中,而不是 Windows XP 中。 灵魂是:

  • 右键单击解决方案资源管理器中的项目
  • 属性
  • 编译选项卡(左侧)
  • 向下滚动以查看高级编译选项按钮
  • 更改放置将目标CPU降低到x86。

Yes. This should happen in you windows 7 and not in windows xp. The soultion is :

  • right click the project in solution explorer
  • Properties
  • Compile tab (left side)
  • Scroll down to see Advanced Compile option button
  • Change the drop down Target Cpu to x86.
£冰雨忧蓝° 2024-07-11 14:15:43

我也有类似的问题,我的机器是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.

淤浪 2024-07-11 14:15:43

安装 DB2 Express-C for win x64,版本 9.7.1
它会起作用

Install DB2 Express-C for win x64, version 9.7.1
and it would work

羞稚 2024-07-11 14:15:43

我在使用 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.

后知后觉 2024-07-11 14:15:43

只是作为一个快速注释...

@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

只是偏爱你 2024-07-11 14:15:43

我在 Windows 2003 x86 服务器上也遇到了这个错误。 本来我的问题是

无法找到请求的.net
框架数据提供者。 可能不是
已安装。

这导致评论说 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

Unable to find the requested .net
framework data provider. it may not be
installed.

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.

焚却相思 2024-07-11 14:15:43

我卸载了以前的 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. :)

我的影子我的梦 2024-07-11 14:15:43

我假设您已经看过 SQL1159DB2 参考指南

不幸的是,原因代码停在 6 处,不会继续到 7。它确实说:

用户响应:您的 DB2 安装出现问题。 如果这是第一次在此计算机上安装 DB2,请检查安装日志是否存在任何可能的错误,并从“添加/删除程序”控制面板小程序运行 DB2 修复。 安装日志的默认位置是执行安装的用户的 My Documents/DB2LOG 文件夹。 如果这不能解决问题,请联系 IBM 支持并提供与此消息关联的原因代码以及任何安装日志。

所以我想尝试重新安装它,如果问题仍然存在,您必须联系 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:

User response: There was a problem with your DB2 installation. If this is the first time DB2 was installed on this computer, review the install logs for any possible errors and run a repair of DB2 from the Add/Remove Programs control panel applet. The default location of the installation logs is the My Documents/DB2LOG folder of the user that performed the installation. If this does not resolve the issue please contact IBM Support and provide the reason code associated with this message along with any installation logs.

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.

夏夜暖风 2024-07-11 14:15:43

您需要让它作为 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.

轻许诺言 2024-07-11 14:15:43

我依稀记得当尝试设置从 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文