Calling AS400 program from vb.net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sam

    Calling AS400 program from vb.net

    Here is what I'm currently doing.

    'Global variable set in the form load
    Private g_cnnISeries As New IBM.Data.DB2.iS eries.iDB2Conne ction

    Dim cmdAddData As New IBM.Data.DB2.iS eries.iDB2Comma nd
    cmdAddData .Connection = g_cnnISeries
    cmdAddData .CommandText = "call mydatalibrary.Q CMDEXC('call
    PGM(ADDDATA) PARM(3, 'ABC')"

    g_cnnISeries.Op en()
    If g_cnnISeries.St ate = ConnectionState .Open Then
    cmdAddBenefits. ExecuteNonQuery ()
    g_cnnISeries.Cl ose()
    End If

    I get an error saying the sql text in not valid. I am able to do a
    select statement and insert SQL statement into the database, but this
    is a program I want to call, so I'm not exactly sure what the syntax
    should be. I've just guessed based on what I could find on the net.

    I want to call the program ADDDATA and pass 2 parameters: 3 (integer)
    and ABC (string).

    Thanks...

Working...