Topic
  • 4 replies
  • Latest Post - ‏2013-09-05T16:59:57Z by Swati Thorve
SystemAdmin
SystemAdmin
2826 Posts

Pinned topic SQL1159 Initialization error with DB2 .NET Data Provider, reason code 2, tokens C:\Program Files\IB

‏2007-09-20T16:02:38Z |
I got the following DB2 error when trying to create a connection. I am using <add assembly="IBM.Data.DB2, Version=9.0.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208"/>

Does any one resolve this yet? Thanks for your response.

SQL1159 Initialization error with DB2 .NET Data Provider, reason code 2, tokens C:\Program Files\IBM\SQLLIB\\bin\db2app.dll,
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: SQL1159 Initialization error with DB2 .NET Data Provider, reason code 2, tokens C:\Program Files\IBM\SQLLIB\\bin\db2app.dll,

Source Error:
Line 11: {
Line 12: string connString = "UID=vporeade;PWD=vporeade;Database=EP_DEV";
Line 13: DB2Connection conn = new DB2Connection(connString);
Line 14:
Line 15:
Source File: c:\cccase\ble_s_gv_scanning_view\gv_scan_gw_vob\Implementation\WebSites\SourceDocQueryWebsite\Admin\Default.aspx.cs Line: 13

Stack Trace:
InvalidOperationException: SQL1159 Initialization error with DB2 .NET Data Provider, reason code 2, tokens C:\Program Files\IBM\SQLLIB\\bin\db2app.dll,
IBM.Data.DB2.f.a() +1880
IBM.Data.DB2.DB2ConnPool.h() +577
IBM.Data.DB2.DB2ConnPool..ctor() +21
IBM.Data.DB2.DB2Connection..cctor() +67
IBM.Data.DB2.DB2Connection..ctor(String connectionString) +0
com.epservices.SourceDocQuery.Web.Admin._Default.Page_Load(Object sender, EventArgs e) in c:\cccase\ble_s_gv_scanning_view\gv_scan_gw_vob\Implementation\WebSites\SourceDocQueryWebsite\Admin\Default.aspx.cs:13
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
com.epservices.SourceDocQuery.Web.BasePage.OnLoad(EventArgs e) in c:\cccase\ble_s_gv_scanning_view\gv_scan_gw_vob\Implementation\WebSites\SourceDocQueryWebsite\App_Code\BasePage.cs:57
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
Updated on 2007-09-26T15:08:06Z at 2007-09-26T15:08:06Z by bpgross
  • bpgross
    bpgross
    627 Posts

    Re: SQL1159 Initialization error with DB2 .NET Data Provider, reason code 2, tokens C:\Program Files\IB

    ‏2007-09-26T15:08:06Z  
    What is the output you get when you run the testconn utility on this machine?

    Brent.
  • Killos
    Killos
    1 Post

    Re: SQL1159 Initialization error with DB2 .NET Data Provider, reason code 2, tokens C:\Program Files\IB

    ‏2013-08-28T17:18:42Z  
    • bpgross
    • ‏2007-09-26T15:08:06Z
    What is the output you get when you run the testconn utility on this machine?

    Brent.

    Hi all,

    I got the same problem with IBM.Data.DB2, Version=9.5. When I try to open the connection from the .NET application I got this exception:

    "SQL1159  Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 9.5.10" System.Exception {System.InvalidOperationException}

    But when I test the connection with testconn20 the connection is fine:

    Step 1: Printing version info
            .NET Framework version: 2.0.50727.5472
            DB2 .NET provider version: 9.0.0.2
            DB2 .NET file version: 9.5.10.2
            Capability bits: ALLDEFINED
            Build: 20120811
            Factory for invariant name IBM.Data.DB2 verified
            Factory for invariant name IBM.Data.Informix verified
               IDS.NET from DbFactory is Common IDS.NET
    VSAI is not installed properly
            Elapsed: 6.3726372

    Step 2: Connecting using "Server=servername:port;Database=dbname;UID=user;PWD=password"
            Server type and version: DB2/AIX64 09.05.0008
            Elapsed: 2.2472247

    Step 3: Selecting rows from SYSIBM.SYSTABLES to validate existence of packages
       SELECT * FROM SYSIBM.SYSTABLES FETCH FIRST 5 rows only
            Elapsed: 0.3470347

    Step 4: Calling GetSchema for tables to validate existence of schema functions
            Elapsed: 1.4291429


    Test passed.

     

    The .NET framework is 4.0 and it fails here:

    try
                {
                    DB2Connection db2Conn = new DB2Connection(GetConnectionString());
                    db2Conn.Open();
                    return db2Conn;
                }
                catch (Exception e)
                {
                    throw;
                }

    Thanks

    Updated on 2013-08-28T17:20:31Z at 2013-08-28T17:20:31Z by Killos
  • Arvind_Gupta
    Arvind_Gupta
    58 Posts

    Re: SQL1159 Initialization error with DB2 .NET Data Provider, reason code 2, tokens C:\Program Files\IB

    ‏2013-08-30T07:53:00Z  
    • Killos
    • ‏2013-08-28T17:18:42Z

    Hi all,

    I got the same problem with IBM.Data.DB2, Version=9.5. When I try to open the connection from the .NET application I got this exception:

    "SQL1159  Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 9.5.10" System.Exception {System.InvalidOperationException}

    But when I test the connection with testconn20 the connection is fine:

    Step 1: Printing version info
            .NET Framework version: 2.0.50727.5472
            DB2 .NET provider version: 9.0.0.2
            DB2 .NET file version: 9.5.10.2
            Capability bits: ALLDEFINED
            Build: 20120811
            Factory for invariant name IBM.Data.DB2 verified
            Factory for invariant name IBM.Data.Informix verified
               IDS.NET from DbFactory is Common IDS.NET
    VSAI is not installed properly
            Elapsed: 6.3726372

    Step 2: Connecting using "Server=servername:port;Database=dbname;UID=user;PWD=password"
            Server type and version: DB2/AIX64 09.05.0008
            Elapsed: 2.2472247

    Step 3: Selecting rows from SYSIBM.SYSTABLES to validate existence of packages
       SELECT * FROM SYSIBM.SYSTABLES FETCH FIRST 5 rows only
            Elapsed: 0.3470347

    Step 4: Calling GetSchema for tables to validate existence of schema functions
            Elapsed: 1.4291429


    Test passed.

     

    The .NET framework is 4.0 and it fails here:

    try
                {
                    DB2Connection db2Conn = new DB2Connection(GetConnectionString());
                    db2Conn.Open();
                    return db2Conn;
                }
                catch (Exception e)
                {
                    throw;
                }

    Thanks

    Hi,

    Please paste the output of  testconn40.

    Also please follow below Technote and see if this resolve your problem.

    http://www-01.ibm.com/support/docview.wss?uid=swg21413731

    Thanks,

    Arvind

  • Swati Thorve
    Swati Thorve
    1 Post

    Re: SQL1159 Initialization error with DB2 .NET Data Provider, reason code 2, tokens C:\Program Files\IB

    ‏2013-09-05T16:59:57Z  

    Other suggestion is, try adding your ASPNET user (if IIS involved) or the user executing application to DB2ADMNS or DB2USERS group.

    Thanks,

    -Swati