tags:

views:

698

answers:

2

Hello,

I want to connect to DB using the iSeries Client Access driver. I use the following connection string:

DRIVER=Client Access ODBC Driver (32-bit);QUERYTIMEOUT=0;PKG=QGPL/DEFAULT(IBM),2,0,1,0,512;LANGUAGEID=ENU;DFTPKGLIB=QGPL;DBQ=QGPL XXXXXXXX;SYSTEM=XXX.XXXXXXX.XXX;Signon=2

I get an exception when connecting:

ERROR [28000] [IBM][iSeries Access ODBC Driver]Communication link failure. comm rc=8015 - CWBSY1006 - User ID is invalid, Password length = 0, Prompt Mode = Never

How can I make the application prompt the user for his credentials to the DB?

+1  A: 

I presume that this is a desktop application and not a server application based on the wording of the application.

If you could make use of the ODBC setup within the ODBC Data Source Administrator, that can be set to use the default setup of iSeries access.

Otherwise, you might have to prompt for the username and password within the application then pass that into the connection string.

Mike Wills
A: 

Here's a quick example of how to make an ODBC connection to an iSeries from Excel. It prompts for user name and password if it doesn't already have a connection. You'll need the iSeries Navigator (aka client access) ODBC driver installed on the client.

Dim DB2Con As New ADODB.Connection

DB2Con.Properties("Prompt") = adPromptComplete DB2Con.Open "DRIVER=Client Access ODBC Driver (32-bit);SIGNON=1;SYSTEM = YOURSYSTEMNAME"

tj