Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: DB2 Stored Procedure, Please help!


Message #1 by ghartge@u... on Thu, 9 Jan 2003 14:27:04
First, Thank you for anyhelp you can offer.

I am trying to call a stored procedure on a DB2 database using ASP 3.0 on a
Windows 2000 server. I can access the DB2 database using ODBC and MS Access
with no problem. I have also been able to connect to other DB2 databses
using ASP with no problem and send/recieve nformation, but this is the
first time I have tried using a stored procedure. The only way I can get
the information out of the DB2 database in question is to use the stored
procedures built by the DB2 developers.

Again, any help would be greatly appreciated. I am in a very Windows
unfriendly environment as far as on site help is concerned.

My code is as follows. I have also read two Wrox books that addressed this
procedure. I have stared at the code and cannot find any differences.

<%
'Set recordset

Set rs = Server.CreateObject("ADODB.Recordset")


'Create new connection and set cursor

Set my390connection = Server.CreateObject("ADODB.Connection")
'my390connection.CursorLocation = adUseClient

ConnectionString = "DSN=NERDB0T;UID=xxx;PWD=xxxxx;"
        
'Open the connection

my390connection.Open ConnectionString

'Set command object (references stored procedure) 

Set my390command = Server.CreateObject("ADODB.Command")

'I have tried this using the "WITH" statement and using the
my390command.ActiveConnection = my390connection method

With my390command
	.ActiveConnection = my390connection
	.CommandText = "BASCHEMA.BAUDD051"
	.CommandType = adCmdStoredProc <------- LINE 34 in ERROR MSG


'Setup Input parameters - Replace "xxxxxxxx" with the UFID you are calling,
Replace "yyyyyyyyyyyy" with your Source ID,
'and Replace "zzzzzzzz" with your UFID in  UPDATED BY UFID

Set inparm1 = my390command.CreateParameter("UFID", adChar, adParamInput, 8,
"11111111")
my390command.Parameters.Append inparm1

Set inparm2 = my390command.CreateParameter("SOURCE ID", adChar,
adParamInput, 12, "API000000001")
my390command.Parameters.Append inparm2

Set inparm3 = my390command.CreateParameter("UPDATED BY UFID", adChar,
adParamInput, 8, "22222222")
my390command.Parameters.Append inparm3


'Setup Output parmeters

Set outparm1 = my390command.CreateParameter("RETURN CODE", adChar,
adParamOutput, 9)
my390command.Parameters.Append outparm1

...
...
...
...

End With
'Set connection

Set my390command.ActiveConnection = my390connection
    
    
'Execute the Stored Procedure

my390command.Execute
%>

The error I recieve is
    * Error Type:
      ADODB.Command (0x800A0BB9)
      Arguments are of the wrong type, are out of acceptable range, or are
in conflict with one another.
/MIGRAINE/include/PersonalInfo.asp, line 34

Thank you so much!

Gary




  Return to Index