Results 1 to 3 of 3

Thread: Calling a iSeries(AS400) CL --RESOLVED--

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2003
    Posts
    40

    Calling a iSeries(AS400) CL --RESOLVED--

    folks,

    was following a MS example on how to call a as400CL using OLE.
    My code:



    Dim ConnString As String
    ConnString = "Provider=IBMDA400; Data Source=AS01DEV; User ID=TJYASNOW; Password=ALICE1;"

    Dim myConnection As New OleDb.OleDbConnection
    myConnection.ConnectionString = ConnString

    Dim myCommand As New OleDb.OleDbCommand("CALL TESTTOM.SWAPSTR(?,?)", myConnection)
    myCommand.CommandType = CommandType.Text

    'setup the parameters
    Dim myParameter As New OleDb.OleDbParameter("param1", OleDb.OleDbType.Char, 10)
    myParameter.Value = "String1"
    myParameter.Direction = ParameterDirection.InputOutput
    myCommand.Parameters.Add(myParameter)

    Dim myParameter2 As New OleDb.OleDbParameter("param2", OleDb.OleDbType.Char, 10)
    myParameter2.Value = "String2"
    myParameter2.Direction = ParameterDirection.InputOutput
    myCommand.Parameters.Add(myParameter2)

    'execute
    Dim results As String
    myConnection.Open()
    myCommand.ExecuteNonQuery()

    myConnection.Close()
    results = myParameter2.Value


    I get this error:

    Server Error in '/AS400Play' Application.
    --------------------------------------------------------------------------------

    SQL7985: CALL statement complete. Cause . . . . . : Call to procedure SWAPSTR completed successfully.



    And the return parm is unchanged. Should be swapped with Param1

    The NET side seems to think a successfull call is an error.
    On the AS400 side the object has been executed because the OS
    tracks it.

    Any suggestions?
    Last edited by Tom Yaz; Feb 12th, 2004 at 07:35 AM.

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