|
-
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.
-
Feb 6th, 2004, 08:21 PM
#2
Addicted Member
It's been a while since I used an iseries but make sure that the parameter is set up as an i/o parameter in you as400CL. not just an i or an o param.
"And most of the evils of society can, in fact, be cured through information. We have a society that has been disinformed and based on the disinformation has made irrational choices. And that's what I mean by 'ignorance.' People, who ordinarily might be smart, are deprived of the data by which to make a rational decision, don't have the data to do it."
Frank Zappa
-
Feb 12th, 2004, 07:38 AM
#3
Thread Starter
Member
Screw OLEDB
Found out from a expert in iseries that IBM's OLE provider for iSeries is buggy. He had the same problem. Used the ODBC provider instead and basically wrote the same code. Worked fine. So now I can make a call to a iseries box pass parms back and forth, execute whatever programs on the iSeries. Way cool. With this I could visulaize .NET being the "front end" app while the iseries doing all the "heavy lifting"
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
|