tags:

views:

4479

answers:

11

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?

+1  A: 

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.

Booji Boy
+1  A: 

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.

Michael Sharek
A: 

@Mike: That did seem like a good guess, unfortunately it didn't work. I uninstalled, removed the folders that they leave lying around, and removed them from the registry. After a reinstall it still has exactly the same problem. The install seems fine, and control center works perfectly. I'm still kind of at a loss on it... sigh.

jsight
+1  A: 

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.

Mark Brackett
A: 

@jsight: I'm sorry to hear that. Probably the best thing to do now is to open a ticket with IBM as it says in the documentation, tell them you get reason code 7 and provide the installation logs to them. Hopefully you have some sort of support agreement in place so that you can do that.

Unfortunately it means there will be no quick resolution. :(

Michael Sharek
A: 

@Mark: Trying the 64bit version will be my next step. Hopefully I can get to that tonight as I don't believe there is any reason to stay with 32. I had used the 32bit installer due to issues getting the 64bit one installed, but I now believe those were unrelated (permissions problems, I think).

jsight
A: 

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

jsight
A: 

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.

icelava
A: 

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

A: 

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.

Farshid
A: 

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

Farshid