• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4026
  • Last Modified:

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?
0
kyleroi
Asked:
kyleroi
  • 4
  • 4
1 Solution
 
kyleroiAuthor Commented:
I forgot to mention that I am 100% sure this is a valid username and password.
0
 
DaveMonCommented:
"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

0
 
DaveMonCommented:
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
kyleroiAuthor 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.
0
 
DaveMonCommented:
Have you ever considered using the OLEDB driver instead of the ODBC?  I dont have the link to the download,  but it worked great for me using VS.2003  and FoxPro tables (VB.Net)  Just  an Idea


Dave
0
 
K3HTCommented:
ill give that a try today, ill let you know if it works.
0
 
kyleroiAuthor 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.
0
 
kyleroiAuthor Commented:
btw... k3ht, is my non-corporate name... IE must have it stored and Firefox has this one stored... lol
0
 
DaveMonCommented:
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
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now