|
-
Feb 6th, 2004, 02:47 PM
#1
Thread Starter
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|