SQL1159 Initialization error with DB2 .NET Data Provider, reason code 2
Asked Answered
C

5

14

I am trying to connect to DB2 from .NET 2.0 application in my development machine running windows 7 64 bit.

I am getting this error in open method. Could not find a solution.

ExceptionType: InvalidOperationException ExceptionMessage: SQL1159 Initialization error with DB2 .NET Data Provider, reason code 2, tokens D:.......................\bin\db2app.dll, StackTrace: at IBM.Data.DB2.DB2ConnPool.Open(DB2Connection connection, String& szConnectionString, DB2ConnSettings& ppSettings, Object& ppConn) at IBM.Data.DB2.DB2Connection.Open()

Chansoo answered 20/9, 2011 at 11:27 Comment(0)
C
14

Learnt this from a colleague of mine. Issue was because db2app.dll was missing in bin directory of application folder.

Copied db2app.dll and db2app64.dll from C:\Program Files\IBM\SQLLIB\BIN to bin folder of application and it worked fine.

Chansoo answered 28/9, 2011 at 6:47 Comment(1)
yes, you need to make sure that the DB2 driver suit is on the PATHOpenminded
M
2

See the "user response" at the bottom of the IBM doc for SQL1159N, which also lists the various reasons you might receive this error code:

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.

Mahon answered 23/9, 2011 at 19:57 Comment(0)
S
1

I had a 32 bit DB2 Client and I was accessing it from a Web Application hosted on IIS, using Application pool (with 'Enable 32-bit Application' set to false). In this case a 64 -bit client (db2app64.dll) is expected while db2app.dll will throw above error.

Just FYI.. It is hard to debug this error in Visual studio as by default IIS express uses 32-bit application pool. To change it to 64-bit, one has to make changes in registry (set Use64BitIISExpress to 1) There is no inetmgr for IIS Express.

Sinasinai answered 16/4, 2015 at 15:25 Comment(0)
G
0

After speaking to IBM, they recommend strongly against putting IBM dlls inside the bin folder. We let IBM remotely configure our server and now all works well and we must not put the ibm*.dll into our bin folders or it will not work.

Gravely answered 26/8, 2014 at 16:38 Comment(0)
J
0

I was also getting same error and While doing troubleshooting, I put in all my credentials for Server IP and database name manually rather than copy pasting and it worked fine.

Jockey answered 11/7, 2023 at 11:56 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.