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

Shetty picture Shetty · Sep 20, 2011 · Viewed 21.5k times · Source

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()

Answer

Shetty picture Shetty · Sep 28, 2011

Learnt this from a colleauge 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 bib folder of application and it worked fine.