Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_ado_rds thread: ADO RDS - Trying to call a function in Oracle using ASP


Message #1 by Rowenap@w... on Tue, 21 Nov 2000 15:53:38 -0000
-----Original Message-----

From: Martin Bellemare [mailto:m_bellemare@j...]

Sent: 21 November 2000 14:55

To: support@w...

Subject: ADO RDS progr. w/asp





I need help!!!!!



I try to call a function in a oracle package using asp* and I always get

the

error message about an invalid parameter type.

there is the sample code for that:



dim objConn 'as ADO connection

set objConn = createobject("ADODB.Connection")

dim objComm 'as ADO command

set objComm = createobject("ADODB.Command")



Set objConn = Server.CreateObject("ADODB.Connection")

objConn.Open "dsn=OracleDSN;uid=ops_pspa;pwd=ops_pspa;"



set objComm.ActiveConnection = objConn



objComm.CommandType = 1 'adCmdText



objComm.CommandText = "{ ? = call MARTIN_TEST.test(?,?) }"



objComm.Parameters(1).Value = cInt(1)

objComm.Parameters(2).Value = cInt(2)



objComm.Execute



Response.Write objComm.Parameters(0).Value



MARTIN_TEST is the package name and test(?,?) is the function who add two

number.



the result of that call is always:



Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC driver for Oracle]Invalid parameter type



Thank you for the help.

Martin.

Message #2 by dany.kattar@f... on Tue, 21 Nov 2000 20:49:51 -0000
Hi,



are you sure about the commandType = adCmdText ?

i called once a stored proc using this method :



* create a Command Object (ex: cmdTransaction)

* set it to the active connection

* cmdTransaction.CommandType = adCmdStoredProc

* cmdTransaction.Text = StoredProcName (your case MARTIN_TEST.test)

* Append the parameters : Parameters

   cmdTransaction.Parameters.Append .CreateParameter("FirstParamName",

adInteger, adParamInput, 12)

adParamReturnValue for the return value



* cmdTransaction.Execute , , adExecuteNoRecords



* RetVal = cmdTransaction.Parameters(RetValParam)



It's hard if you don't have documentation on the above, but i hope this

will help



Cheers,

Dany

Message #3 by "jigs gandhi" <newsgroup@h...> on Wed, 22 Nov 2000 09:22:19 +0530
This is a multi-part message in MIME format.



------=_NextPart_000_01E7_01C05465.B69322E0

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



hi,



what is the data-type of parameter you are passing ?



anyways, try using the connection object instead



FOR ORACLE

strCommand =3D "@myproc param1 param2 param3"

FOR SQL SERVER

strCommand =3D "exec myproc param1 param2 param3"



if not returning any values

conn.execute(strCommand)

if returning values

set rs =3D conn.execute(strCommand)





jigs

----- Original Message -----

  From: Rowenap@w...

  To: ASP_ADO_RDS

  Sent: Tuesday, November 21, 2000 9:23 PM

  Subject: [asp_ado_rds] ADO RDS - Trying to call a function in Oracle 

using ASP





  -----Original Message-----

  From: Martin Bellemare [mailto:m_bellemare@j...]

  Sent: 21 November 2000 14:55

  To: support@w...

  Subject: ADO RDS progr. w/asp





  I need help!!!!!



  I try to call a function in a oracle package using asp* and I always 

get

  the

  error message about an invalid parameter type.

  there is the sample code for that:



  dim objConn 'as ADO connection

  set objConn =3D createobject("ADODB.Connection")

  dim objComm 'as ADO command

  set objComm =3D createobject("ADODB.Command")



  Set objConn =3D Server.CreateObject("ADODB.Connection")

  objConn.Open "dsn=3DOracleDSN;uid=3Dops_pspa;pwd=3Dops_pspa;"



  set objComm.ActiveConnection =3D objConn



  objComm.CommandType =3D 1 'adCmdText



  objComm.CommandText =3D "{ ? =3D call MARTIN_TEST.test(?,?) }"



  objComm.Parameters(1).Value =3D cInt(1)

  objComm.Parameters(2).Value =3D cInt(2)



  objComm.Execute



  Response.Write objComm.Parameters(0).Value



  MARTIN_TEST is the package name and test(?,?) is the function who add 

two

  number.



  the result of that call is always:



  Microsoft OLE DB Provider for ODBC Drivers error '80004005'

  [Microsoft][ODBC driver for Oracle]Invalid parameter type



  Thank you for the help.

  Martin.



  ---

  Wrox Professional Web Developer Conference II

  http://www.wroxconferences.com/WebDevEurope

  November 29th - December 1st 2000, Amsterdam, Netherlands

  Create powerful distributed web applications serving you now and

  in the future. From ASP+ and VB.NET to XML and SQL Server 2000




$subst('Email.Unsub')











  Return to Index