Link to home
Create AccountLog in
Avatar of kyleroi
kyleroiFlag for United States of America

asked on

ODBC Connection

I am having problems connecting to our AS/400 system via a C#.NET app.  I created a test app to reproduce the error.  Here is the code.....

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.Odbc;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            OdbcConnection cn = new OdbcConnection();
            cn.ConnectionString = "Driver={Client Access ODBC Driver (32-bit)};System=192.168.0.2;Uid=ADMIN1;Pwd=ADMIN1)";
            cn.Open();
            cn.Close();
        }
    }
}

When I go to open the connection I get the error below.

ERROR [28000] [IBM][iSeries Access ODBC Driver]Communication link failure. comm rc=8002 - CWBSY0002 - Password for user ADMIN1 on server 192.168.0.2 is not correct, Password length = 7, Prompt Mode = Never, System IP Address = 192.168.0.2
ERROR [28000] [IBM][iSeries Access ODBC Driver]Communication link failure. comm rc=8002 - CWBSY0002 - Password for user ADMIN1 on server 192.168.0.2 is not correct, Password length = 7, Prompt Mode = Never, System IP Address = 192.168.0.2

I know the connection string is correct because when I use the same connection string in FoxPro I do not receive errors.  

Any Ideas?
Avatar of kyleroi
kyleroi
Flag of United States of America image

ASKER

I forgot to mention that I am 100% sure this is a valid username and password.
"I am 100% sure this is a valid username and password"  ....   haha  famous  last words  just  kidding,  but keep checking that while troubleshooting,  

I noticed your AS/400 has an IP of 192.168.0.2,  is this a correct address for machines on your network?  

could I talk you into "toggling" the password from its existing one,  to a new one and see if anything changes? Then back to the original.

You did not say if you were the AS400 admin.  Do all existing apps/connections still function correctly?(except this one)    Do any other apps use the same login?

Dave

I found this.....  it may help

Hi,

1. Have you checked the JDE.INI on the Windows box?
2. If you're running with Security Server, the SQL
Server login "JDE" on the Windows box has to have the
same password as the OS/400 "JDE" user on the AS/400 box.
Avatar of kyleroi

ASKER

Thank you for your response, I tried what you have mentioned but it is not helping.  It must by a C# issue because the same connection string works in FoxPro which should work in C#.  Maybe C# handles odbc differently.
ASKER CERTIFIED SOLUTION
Avatar of DaveMon
DaveMon
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of K3HT
K3HT

ill give that a try today, ill let you know if it works.
Avatar of kyleroi

ASKER

It Worked!!!!

Thanks for your help, I really wish I knew why odbc didn't work, no need for it really but it will bug me.  Anyway, thanks again.
Avatar of kyleroi

ASKER

btw... k3ht, is my non-corporate name... IE must have it stored and Firefox has this one stored... lol
wow,  Im glad it  worked,  I stumbled across it when I had nothing but trouble with ODBC.  In my opinion,  it  has too much compatability...  ( ie.  trying to be everything to everyone )

glad you are pleased

Dave