Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to Call RGP from ASP

Status
Not open for further replies.

Esoteric

ISP
Feb 10, 2001
93
US
Here is what I have:

Set MySystem = Server.CreateObject("ADODB.Connection")
MySystem.Open "DSN=LIBRARY;UID=USERNAME;PWD=PASSWORD"
Set MyProgram = Server.CreateObject("ADODB.Command")

Set MyProgram.ActiveConnection = MySystem
MyProgram.CommandText = "{CALL LIBRARY.PROGRAM(?)}"
MyProgram.Prepared = True

MyProgram.Parameters.Append Myprogram.CreateParameter("CustomerNumber",3,1,10,1)

MyProgram.Parameters(0).Value = 1
MyProgram.Execute

Here is my error:
[IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]SQL0204 - PROGRAM in LIBRARY type *N not found.


I am sure its something to do with the parameters but how to I actually get it to function correctly.
Please advise, or supply me a way that actually works.
 
Here's what I do to pass parameters from a VBA subroutine to call a stored procedure. That should help.

Public Sub MySub()

'************************************
'* Call stored procedure MYLIB.MYSP
'************************************

Dim YOUR400 As New cwbx.AS400System
Dim servers As New cwbx.systemNames
Dim Command As New cwbx.Command
Dim objConn As New ADODB.Connection
Dim objCmd As New ADODB.Command

objConn.Open "Provider=IBMDA400;Data Source=My_AS400_IP;Default Collection=MYLIB ", "", ""

Set objCmd.ActiveConnection = objConn
objCmd.CommandText = "MYSP"
objCmd.CommandType = adCmdStoredProc

Set parm1 = objCmd.CreateParameter("Parm1")
parm1.Type = adVarChar
parm1.Direction = adParamInput
parm1.Size = 7
parm1.Value = "0045000"
objCmd.Parameters.Append parm1

Set parm2 = objCmd.CreateParameter("Parm2")
parm2.Type = adVarChar
parm2.Direction = adParamInput
parm2.Size = 3
parm2.Value = "057"
objCmd.Parameters.Append parm2

Set parm3 = objCmd.CreateParameter("Parm3")
parm3.Type = adVarChar
parm3.Direction = adParamInput
parm3.Size = 10
parm3.Value = "2003-11-24"
objCmd.Parameters.Append parm3

'Notice that Parm4 is set in I/O mode
Set parm4 = objCmd.CreateParameter("Parm4")
parm4.Type = adVarChar
parm4.Direction = adParamReturnValue
parm4.Size = 5
parm4.Value = "00000"
objCmd.Parameters.Append parm4
objCmd.Execute

MsgBox parm4, , "Parm4 Value"

Set objCmd = Nothing
Set objConn = Nothing

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top