Note that there are some explanatory texts on larger screens.

plurals
  1. POc# to AS400 / JD Edwards - run program - Data source name not found and no default driver specified
    primarykey
    data
    text
    <p>UPDATE: The code example below works. I changed the connection string. That was the problem. For an alternative (non-ADO) solution, see Mike Wills's link in the comments.</p> <p>I have a c# class that (if I ever get it working) runs a program written in RPG code on AS/400 - JD Edwards. I know next to nothing about AS/400 and/or JD Edwards.</p> <p>I've got other classes in my (intranet) web app that connect to JD Edwards, running SQL queries and setting/getting data. All of these are using the IBM.Data.DB2.iSeries dll and are working great.</p> <p>For this, I wrote a similar class using the aforementioned dll, but it wasn't working. I even read somewhere online that you can't run a program using this dll. I found that a little fishy, but on suggestion from my JD Edwards co-worker, I scrapped the class and re-wrote it using the adodb dll. No data need be returned from this program run. I just want the program to run.</p> <p>Here is a dummified version of the class:</p> <pre><code> private void runJDEProgram() { ADODB.Connection cn = new ADODB.Connection(); cn.ConnectionString = "Provider=ABABAB;Data Source=111.111.111"; ADODB.Command cmdDetail = new ADODB.Command(); cn.Open(); //has to be open before setting an active connection. cmdDetail.ActiveConnection=cn; cmdDetail.CommandType = ADODB.CommandTypeEnum.adCmdText; cmdDetail.CommandText = "{{CALL BLAH.BLAH(?,?)}}"; cmdDetail.Prepared = true; cmdDetail.Parameters.Append(cmdDetail.CreateParameter("P1", ADODB.DataTypeEnum.adChar, ADODB.ParameterDirectionEnum.adParamInput, 10, "BLAH123")); cmdDetail.Parameters.Append(cmdDetail.CreateParameter("P2", ADODB.DataTypeEnum.adChar, ADODB.ParameterDirectionEnum.adParamInput, 10, "BLAH456")); object dummy = Type.Missing; //otherwise, we couldn't get past this. cmdDetail.Execute(out dummy, ref dummy, 0); cn.Close(); } </code></pre> <p>Here's the error I get when it runs:</p> <pre><code>{"[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"} </code></pre> <p>Where am I screwing up? Thanks!</p> <p>EDIT: The connection string works when querying the AS/400 to get/set data. Does it need to be modified for an operation like this, or for use with ADO? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload