We help IT Professionals succeed at work.

ODBC Connection

kyleroi
kyleroi asked
on
4,538 Views
Last Modified: 2013-12-06
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?
Comment
Watch Question

Author

Commented:
I forgot to mention that I am 100% sure this is a valid username and password.

Commented:
"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

Commented:
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.

Author

Commented:
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.
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
ill give that a try today, ill let you know if it works.

Author

Commented:
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.

Author

Commented:
btw... k3ht, is my non-corporate name... IE must have it stored and Firefox has this one stored... lol

Commented:
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

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.