Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Example ADO function

Re: Example ADO function

From: Pile <philipwinfield_at_totalise.co.uk>
Date: 16 Jun 2003 13:57:34 -0700
Message-ID: <f2fcb581.0306161257.493e5cee@posting.google.com>


stephen.howard_at_us.pwcglobal.com (Steve Howard) wrote in message news:<6d8b7216.0306160908.5b2db3ed_at_posting.google.com>...

> "Jim Kennedy" <kennedy-down_with_spammers_at_attbi.com> wrote in message news:<OGkHa.1010498$Zo.229689_at_sccrnsc03>...

> > The answer is clear. The driver does not support that operation.(see error
> > message). Find yourself another driver.
> > Jim
> >
> > --
> > Replace part of the email address: kennedy-down_with_spammers_at_attbi.com
> > with family. Remove the negative part, keep the minus sign. You can figure
> > it out.
> > "Pile" <philipwinfield_at_totalise.co.uk> wrote in message
> > news:f2fcb581.0306160238.4313d575_at_posting.google.com...
> > > Hi,
> > > I have searched high and low but can not find the answer to this.
> > > Without going down the 004O route please could someone comment on the
> > > following.
> > >
> > > All it consists of is a very simple package, and a very simple ASP
> > > page. I just want to be able to call a function via ASP but so far
> > > have not been successful.
> > >
> > > Error I get is:Error Type:
> > > Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
> > > ODBC driver does not support the requested properties.
> > > /fastcoder/query.asp, line 30
> > >
> > > Many thanks in advance.......
> > >
> > > CODE (Oracle 1st & then the asp Page)
> > > =====================================
> > >
> > > CREATE OR REPLACE PACKAGE test_pkg
> > > AS
> > >
> > >
> > > TYPE cursor_type IS REF CURSOR;
> > >
> > > FUNCTION fn_fastsearch (
> > > p_query IN VARCHAR2
> > > ,p_querytype IN PLS_INTEGER
> > > ) return cursor_type;
> > >
> > > END test_pkg;
> > > /
> > > CREATE OR REPLACE PACKAGE BODY test_pkg
> > > AS
> > >
> > > FUNCTION fn_fastsearch
> > > (
> > > p_query IN VARCHAR2
> > > ,p_querytype IN PLS_INTEGER
> > > )
> > > return cursor_type IS
> > >
> > >
> > > l_cursor fastcode_pkg.cursor_Type;
> > >
> > > BEGIN
> > >
> > > open l_cursor for select object_name from all_objects where
> > > rownum<100;
> > > return l_cursor;
> > >
> > > END;
> > >
> > >
> > > END test_pkg;
> > > /
> > >
> > >
> > > -- Cut here, NOW THE ASP PAGE...
> > >
> > >
> > > <html>
> > > <head>
> > > <title>Result of Database Query</title>
> > > </head>
> > > <!-- #include file="adovbs.inc" -->
> > > <!-- #include file="common.asp" -->
> > > <%
> > >
> > >
> > > Private Function GetData()
> > > SET rs = Server.CreateObject("ADODB.Recordset")
> > > set Con = Server.CreateObject("ADODB.Connection")
> > > set cmd =Server.CreateObject("ADODB.Command")
> > > set InputParam1 = Server.CreateObject("ADODB.Parameter")
> > > set InputParam2 = Server.CreateObject("ADODB.Parameter")
> > >
> > > con.ConnectionString = "driver={Microsoft ODBC for Oracle};
> > > server=pcom; uid=test;pwd=test"
> > > con.Open
> > >
> > > cmd.ActiveConnection = con
> > > cmd.CommandText = "test_pkg.fn_fastsearch"
> > > cmd.CommandType = adCmdStoredProc
> > > Set InputParam1 =
> > > cmd.CreateParameter("Prm1",adVarChar,adParamInput,44,"ahdakjdh")
> > > Set InputParam2 =
> > > cmd.CreateParameter("Prm2",adInteger,adParamInput,,25)
> > >
> > >
> > > cmd.Parameters.Append InputParam1
> > > cmd.Parameters.Append InputParam2
> > >
> > > set rs= cmd.Execute
> > >
> > > ' If this works, add in a loop to write result into table.
> > >
> > > End Function
> > >
> > > %>
> > > <body>
> > >
> > > <h1>Result of Database Query - ASP/VBScript</h1>
> > > <%=GetData()%>
> > >
> > > </body>
> > > </html>
> 
> Hi Pile,
> 
> It has been awhile since I wrote ASP, but IIRC, you need an out
> parameter in ADO for the return value of the function.
> 
> HTH,
> 
> Steve



Thanks Steve, yes I have seen this but this did not work either. And Jim, thanks for your helpful observation of the error message. Yes, it was obvious so I upgraded to the 9.2.0.4 version of the Oracle ODBC driver - if you know of another that will work or an alternative code approach that might be useful. Received on Mon Jun 16 2003 - 15:57:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US