SQL1159 Initialization error with DB2 .NET Data Provider, reason code 7, tokens 9.5.0.DEF.2, SOFTWARE\IBM\DB2\InstalledCopies

StackOverflow https://stackoverflow.com/questions/29370

  •  09-06-2019
  •  | 
  •  

Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

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.

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. :)

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.

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

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.

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

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.

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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top