Link to home
Start Free TrialLog in
Avatar of ddorado
ddorado

asked on

ADODB.Recordset error '800a0e78'

Sorry, my english is no good, and I'm desperated.

I work with Stored procedures (SQL Server 2000) and IIS 5.0 with a asp aplication.


My store procedure:

CREATE Procedure p_lee_archivos(
@idSubCategoria int = null,
@id int OUTPUT,
@Categoria varchar (50) OUTPUT,
@SubCategoria varchar(50) OUTPUT,
@archivo varchar (50) OUTPUT,
@descripcion varchar (256) OUTPUT,
@anchoalto varchar (20) OUTPUT,
@tamano bigint OUTPUT,
@fechaAlta varchar (50) OUTPUT,
@Descargas bigint OUTPUT,
@tipo char (4) OUTPUT,
@enviadoPor varchar (100) OUTPUT,
@creditosNecesarios int OUTPUT)
AS
SET NOCOUNT ON
BEGIN
select id,archivo,descripcion,anchoalto,
CAST(tamano/1024 as int) as  tamano,
FLOOR((tamano/1024)/250) as creditosNecesarios,
fechaalta, descargas,tipo,enviadopor, categoria, subcategoria
from datos where
idsubcategoria = @idsubcategoria
order by descripcion
END


My asp code:

<%'p_lee_archivos
Set conexion = Server.CreateObject("ADODB.Connection")
conexion.open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=xxxx;PWD=xxxxxx;Initial Catalog=xxxx;Data Source=XXXXX"

set cmd = Server.CreateObject("ADODB.Command")
set cmd.ActiveConnection = conexion
cmd.commandtype = 4
cmd.commandtext = "p_lee_archivos"

set idSubCategoria =   cmd.createparameter("idSubCategoria",adInteger,adParamInput)
cmd.Parameters.Append idSubCategoria
idSubCategoria.Value = Request("idSubCategoria")

set id =   cmd.createparameter("id",adInteger,adParamOutput)
cmd.Parameters.Append id

set Archivo=  cmd.createparameter("Archivo",adVarChar,adParamOutput,50)
cmd.Parameters.Append Archivo
                         
set Categoria=  cmd.createparameter("Categoria",adVarChar,adParamOutput,50)
cmd.Parameters.Append Categoria

set subCategoria=  cmd.createparameter("subCategoria",adVarChar,adParamOutput,50)
cmd.Parameters.Append subCategoria

set Descripcion=  cmd.createparameter("Descripcion",adVarChar,adParamOutput,50)
cmd.Parameters.Append Descripcion

set anchoAlto =   cmd.createparameter("anchoAlto",adVarChar,adParamOutput,20)
cmd.Parameters.Append anchoAlto              
                         
set Tamano =   cmd.createparameter("Tamano",adBigInt,adParamOutput)
cmd.Parameters.Append Tamano
                         
set fechaAlta =   cmd.createparameter("fechaAlta",adVarChar,adParamOutput,50)
cmd.Parameters.Append fechaAlta

set Descargas =   cmd.createparameter("Descargas",adBigInt,adParamOutput)
cmd.Parameters.Append Descargas

set Tipo =   cmd.createparameter("Tipo",adVarChar,adParamOutput,50)
cmd.Parameters.Append Tipo

set enviadoPor =   cmd.createparameter("enviadoPor",adVarChar,adParamOutput,50)
cmd.Parameters.Append enviadoPor
                         
set creditosNecesarios =   cmd.createparameter("creditosNecesarios",adInteger,adParamOutput)
cmd.Parameters.Append creditosNecesarios

set resultados = Server.CreateObject("ADODB.Recordset")
resultados.Open cmd                    
                         
                         
While not resultados.EOF%>

Print any param

<%resultados.MoveNext()
Wend
set resultados = nothing
set cmd = nothing
conexion.close
Set conexion = nothing
%>



The error:

ADODB.Recordset error '800a0e78'
La operación no está permitida si el objeto está cerrado.

/archivos_subcategoria.asp, line 97
 


The stored procedure works fine.

Other stored procedures and other asp pages, with similar code works OK.

I don't understand anything, because that's  my first experience in stored procedures with asp.

Best regards
Diego

ASKER CERTIFIED SOLUTION
Avatar of navneet77
navneet77

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CleanupPing
CleanupPing

ddorado:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.