ADO 1.5 CMD error when executing Stored Procedures?? 
Author Message
 ADO 1.5 CMD error when executing Stored Procedures??

I am attempting to execute a program on an AS/400 via ADO.  Here is the code
that I have currently.  I am able to execute this manually but it will not
work over ODBC/ADO.  Any ideas guys?

    Dim Conn As New ADODB.Connection
    Dim Cmd As New ADODB.Command
    Dim Rst As New ADODB.Recordset
    Dim sCreate As String
    Dim sDrop As String

    Conn.Open "DSN=QDSN_APPN.KRAMER", "TERRI2", "TERRIT"
    sDrop = "DROP PROCEDURE TAMLIB.TEST"
    sCreate = "CREATE PROCEDURE TAMLIB.TEST (:VAPP IN CHAR(3),:VTYPE IN
CHAR(8),:VIDX IN CHAR(15),:VCOMMENT IN CHAR(120)," + _
    ":VCASE INOUT CHAR(9),:VUSER IN CHAR(10)) (EXTERNAL NAME
TAMLIB.FLOWRQSTR LANGUAGE COBOL SIMPLE CALL)"

    Conn.Execute sDrop
    Conn.Execute sCreate
    Cmd.ActiveConnection = Conn
    Cmd.CommandType = adCmdStoredProc
    Cmd.Parameters.Refresh
    Cmd.Parameters(0).Value = "RE"
    Cmd.Parameters(1).Value = "HARDCOPY"
    Cmd.Parameters(2).Value = "123123123"
    Cmd.Parameters(3).Value = "This is another test!"
    'Parameter 4 is the return value but must be passed in!
    Cmd.Parameters(5).Value = "TERRI2"

    Cmd.CommandText = "{CALL TAMLIB.TEST (?,?,?,?,?,?)}"
    Cmd.Execute

The error that is returned mentions something about a required value not
being set.  I tried passing in spaces or values for the InOut parameter(4)
but I still receive the same error.

Thanks in advance! :)

Oron Gill Haus



Sun, 20 May 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ADO 1.5 and Oracle stored procedures

2. ADO 1.5 CMD Error when returning values from Stored Procedure??

3. VB5EE setup wizard and mdac 1.5 (ado 1.5) problem

4. ADO: cmd.Execute vs cn.Execute

5. Vb5/ADO 1.5/Oracle 7.3 Long Raw field - .GetChunk causes App error

6. VB5 and Error Handling in ADO 1.5

7. How to execute a Stored Procedure using ADO.Net

8. ADO executing oracle stored procedure/function

9. Problem with executing stored procedures using ADO

10. problem in executing an Oracle stored procedure by ADO

11. Problem with executing stored procedures using ADO

12. VB6 ADO Stored Procedure Execute

 

 
Powered by phpBB® Forum Software