<% 'Dim cmd As ADODB.Command ' Dim rs As ADODB.Recordset ' Dim strCnn As String ' Dim Count As Integer ' Dim cn As ADODB.Connection Set cn = CreateObject("ADODB.Connection") strCnn = "driver={Oracle ODBC Driver};uid=scott;pwd=tiger;DBQ=zeal" cn.Open strCnn Set cmd = CreateObject("ADODB.Command") Set cmd.ActiveConnection = cn cmd.CommandText = "SELECT EMPNO, ENAME FROM EMP" 'cmd.CommandType = adCmdText cmd.CommandType =&H0001 Set rs = CreateObject("ADODB.Recordset") rs.CursorType = adUseOdbc Set rs = cmd.Execute Response.write "Retrive Emp table from Database" Response.write "" rs.Close ' add for stored function cmd.CommandText = "SimpleCalc.Multiply2" ' cmd.CommandType = adCmdStoredProc cmd.CommandType = &H0004 ' Set InputParam = cmd.CreateParameter("Param1", adSmallInt, adParamInput, , 30) Set InputParam = cmd.CreateParameter("Parma1", 2, &H0001, , 1004) 'Using adParamOutPut instead of adParamReturnValue will result in the following error: 'ORA-24334 - no descriptor for this position 'Set Param2 = cmd.CreateParameter("Param2", adSmallInt, adParamOutput) ' Set ReturnParam = cmd.CreateParameter("Prm2", adSmallInt, adParamReturnValue) Set ReturnParam = cmd.CreateParameter("Param2", 2, &H0004) 'You will also get the ORA-24334 error if you don't Append the parameters 'in the correct order. Make sure to bind the Returning parameter first. cmd.Parameters.Append ReturnParam cmd.Parameters.Append InputParam cmd.Execute Response.write "Get retrun data from stored Function

" Response.write "Input Value = " & cmd.Parameters(1) Response.write "
" Response.write "Return Value = " & cmd.Parameters(0) ' end add for stored function cn.Close Set rs = Nothing Set cmd = Nothing Set cn = Nothing %>