1

I'm using the IBM.Data.DB2.iSeries.dll to connect to a IBM DB2 Database.

It works fine, connection is open and all operations can be made. But when you start the conn.open() method, IBM sends a warning - window to the user that his password expires. I suppose this window comes directly from Client Access.

class Program
{
    static void Main(string[] args)
    {
        string connString = "DataSource=SYSTEM;UserID=USER;Password=PASSWORD";
        iDB2Connection conn = new iDB2Connection(connString);
        conn.Open();
    }
}

enter image description here

I've found this thread: JT400.jar Disable Login Screen and how to disable this behaviour with the jt400.jar, but nothing about the IBM.Data.DB2.iSeries.dll.

Is there any possible way to hide or to block this window in C#?

Community
  • 1
  • 1
Craylen
  • 313
  • 2
  • 12
  • 1
    I think the answer should be in http://www.redbooks.ibm.com/abstracts/sg246440.html, had a quick look but haven't found it yet. – mike May 16 '17 at 09:57
  • In the redbook in above link there is an example (4-5) of specifying the Password property in the ConnectionString: iDB2Connection cn = new iDB2Connection(); cn.ConnectionString = "DataSource=myiSeries; UserID=myuserid; Password=mypassword;"; – mike May 16 '17 at 10:02
  • 1
    I've found a hint on page 245: "Important: When using the provider through ASP .NET / IIS, the connection string should always contain the authentication credentials, such as the UserID and Password elements. Otherwise a logon window may appear at the server side, which would make the Web client appear to hang" - this is exactly what happens. But there is no solution to block the window. – Craylen May 16 '17 at 10:53

1 Answers1

1

The following IBM Support article suggests using System i Navigator to set the "prompting behaviour". You can try to see whether this helps.

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

To change user ID and password prompting behavior within Access for Windows is through the Navigator, do the following: 1. Open the System i Navigator. 2. Right-click on the System name. and click on Properties. 3. Click on the connection tab, and select one of the following options:

o Specify Prompt every time. This prompts for a password every time a connection is made to the operating system.

o Specify Use default user id/password prompt, as needed. This prompts for an initial signon and does not prompt again during a Microsoft® Windows® session.

o Specify Use windows user id/password (never prompt). This does not prompt for a user ID or password and uses the Windows logon to sign on the operating system.

o Specify Use Kerberos. This will use the Windows Kerberos ticket for authorization and requires EIM setup on the operating system.

You have the Navigator installed right ?

There is an IBM Support article for the connection string for OLE DB. The .Net connection string properties is possibly similar. BUT, even here there are no details about the suppressing the dialog box from the application.

OLE DB connection properties: http://www-01.ibm.com/support/docview.wss?uid=nas8N1017400

The following list contains all of the custom properties that are available for the OLE DB providers shipped with iSeries Access for Windows (IBMDA400, IBMDARLA, and IBMDASQL). The release at which each property was added is indicated. For more information about any of these properties, consult the OLE DB technical reference that can be found in the Programmer's Toolkit included with iSeries Access for Windows.

Subbu
  • 2,130
  • 1
  • 19
  • 28