DB2 Connection Issue

G

Guest

OK, I am trying to connect to DB2 (z/OS). I have successfully made the
connection to the database in the Server Explorer. I am also able to
successfully log in to DB2 when I am testing the "System DSN" in the ODBC
configuration tool (MS).

When In server Explorer, I click on my connection object and then select
properties to get the connection information. I then copy this connection
information and place it into a string object so that I can configure all the
connection information in my code. I add to that connection information the
"Password" as this does not show up in the properties.

When I attempt to connect to the Database, I get and error which suggest
that the user ID/Password is invalid. I know that this password and user ID
is valid, so it must be something else. A format issue or perhaps there is
somethine which is missing in the properties other then password. Below is
my connection information. I presume that I am connecting via ODBC (the
error mseeage points this out), but there is nothing in the properties for
the connection (within server explorer) which specifies that.

Dsn=DB29;uid=XXXXXX;pwd=YYYYYY,dbalias=DB29;schemalist='GATSC'

Here is the error message that I am getting...
ERROR [08001] [IBM][CLI Driver] SQL30082N
Attempt to establish connection failed with security reason \"24\"
(\"USERNAME AND/OR PASSWORD INVALID\"). SQLSTATE=08001\r\n\r\nERROR [IM006]
[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed"}
System.Exception {System.Data.Odbc.OdbcException}

SO what might be the problem?

Thanks in advance for your assistance!!
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Take a look at connectionstrings.com

OLE DB, OleDbConnection (.NET) from ms


a.. TCP/IP:

"Provider=DB2OLEDB;Network Transport Library=TCPIP;Network
Address=XXX.XXX.XXX.XXX;Initial Catalog=MyCtlg;Package
Collection=MyPkgCol;Default Schema=Schema;User ID=MyUser;Password=MyPW"



b.. APPC:

"Provider=DB2OLEDB;APPC Local LU Alias=MyAlias;APPC Remote LU
Alias=MyRemote;Initial Catalog=MyCtlg;Package Collection=MyPkgCol;Default
Schema=Schema;User ID=MyUser;Password=MyPW"
ODBC


a.. Standard:

"driver={IBM DB2 ODBC
DRIVER};Database=myDbName;hostname=myServerName;port=myPortNum;protocol=TCPIP;
uid=myUserName; pwd=myPwd"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top