Alright,
Here is the code that I have (i got it from one of these newsgroups
and then changed it). I am calling a stored procedure on AS400. This
SP takes 5 parameters.
It seems like I can open the connection but when It blows up at
objCommand.ExecuteNonQuery() method call. The exception that I get is
"ERROR [HY000][IBM][Client Access Express ODBC Driver(32-bit)][DB2/400
SQL]SQL0301 - Input host variable
I have no idea what that means.
By they way I have already made sure that Stored procedure is there.
Can anybody help?
Thanks
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Dim objConnection As New
OdbcConnection("DSN=AS400Connection;UID=myuid;PWD=mypwd")
Dim objCommand As New OdbcCommand("{ Call DS101SP1(?, ?, ?, ?,
?) }", objConnection)
Dim objParameter1 As New OdbcParameter
With objParameter1
.ParameterName = "MyParm1"
.DbType = DbType.AnsiString
.Direction = ParameterDirection.InputOutput
.Size = 6
.Value = "147031"
End With
objCommand.Parameters.Add(objParameter1)
Dim objParameter2 As New OdbcParameter
With objParameter2
.ParameterName = "MyParm2"
.DbType = DbType.AnsiString
.Direction = ParameterDirection.InputOutput
.Size = 4
.Value = "8487"
End With
objCommand.Parameters.Add(objParameter2)
Dim objParameter3 As New OdbcParameter
With objParameter3
.ParameterName = "MyParm3"
.DbType = DbType.AnsiString
.Direction = ParameterDirection.InputOutput
.Size = 1
.Value = "1"
End With
objCommand.Parameters.Add(objParameter3)
Dim objParameter4 As New OdbcParameter
With objParameter4
.ParameterName = "MyParm4"
.DbType = DbType.AnsiString
.Direction = ParameterDirection.InputOutput
.Size = 1
.Value = "A"
End With
objCommand.Parameters.Add(objParameter4)
Dim objParameter5 As New OdbcParameter
With objParameter5
.ParameterName = "MyParm5"
.DbType = DbType.AnsiString
.Direction = ParameterDirection.InputOutput
.Size = 1
.Value = "B"
End With
objCommand.Parameters.Add(objParameter5)
objCommand.CommandType = CommandType.StoredProcedure
objConnection.Open()
Try
objCommand.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
End Try
objConnection = Nothing
objCommand = Nothing
objParameter1 = Nothing
objParameter2 = Nothing
objParameter3 = Nothing
objParameter4 = Nothing
objParameter5 = Nothing
End Sub
(e-mail address removed) (DB2) wrote in message
StarQuest has a driver for DB2 (
www.starquest.com), I believe it's
much cheaper than Ritmo.
Bob
(e-mail address removed) (Sehboo) wrote in message