Results 1 to 2 of 2

Thread: Rrror while connectiong DB2 using ODBC

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    india
    Posts
    273

    Rrror while connectiong DB2 using ODBC

    Dear All,
    I have installed iSeries Access ODBC Driver Version 11.00.08.00. I have created System DSN ODBC Connection to connect to DB2 database (JDE).
    I have created macro in excel and added Micosoft Active X Library
    Using below connection string
    Code:
    "Provider=MSDASQL.1;Persist Security Info=False;User ID=PPCC;PASSWORD=****;Data Source=Business Data - PROD;QueryTimeOut=0;"
    i am able to connect to DB2 database of JDE.

    But same connection string does not work in .net/
    Code:
    using System.Data.Odbc;
    
    OdbcConnection cn = new OdbcConnection(
       "Provider=MSDASQL.1;Persist Security Info=False;User ID=PPCC;PASSWORD=****;Data Source=Business Data - PROD;QueryTimeOut=0;");
    
    cn.Open();
    OdbcCommand cmd = new OdbcCommand("SELECT COUNT(*) FROM TABLENAME", cn);
    it is throwing error:
    Code:
    ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    what could be the reason and what is the worlaround.

    I need help,Please

    Regards,
    PPCC

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Rrror while connectiong DB2 using ODBC

    Hello,

    It could be that the connection string that is required is different.

    Have you checked here:

    http://connectionstrings.com/

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width