I am trying send information to the DB and the SP will return a recordset. The problem is that I keep getting this error (ADODB.Recordset error '800a0e78' Operation is not allowed when the object is closed). I saw a bunch of posts using queries, but none using SPs and cannot resolve the issue.

Here is a sample of the code... If more is needed let me know

Dim IsRate    Dim cmd
    Dim rs
        
    Set cmd = createobject("ADODB.Command")
    Set rs = createobject("ADODB.RecordSet")
    with cmd
        .ActiveConnection=gObjConnect
	    .CommandType=adCmdStoredProc
	    .CommandText="RateList_test"
        .Parameters.Append .CreateParameter("@ZipFrom",adVarChar, adParamInput,6,mZipFr)
        .Parameters.Append .CreateParameter("@ZipTo", adVarChar, adParamInput,6,mZipTo)

'........

.Parameters.Append .CreateParameter("@RateUsed", adInteger, adParamOutput,,0)
        Set rs = cmd.Execute
        IsRate = cmd.Parameters("@RateUsed")
        response.Write rs.Status
        end with
        set cmd = nothing

	Dim sqlCar, RScar, SFlag	
	SweeneyFlag = 0
	if not rs.eof then '-->Fails here

If this does not make sense or more info is needed, please let me know.

I guess what I am ultimately asking is how to open the rs connection when the command object is used.

Anyone have any ideas at all where this could be going wrong?

I am not sure if you have specified the parameter stuff to the SP correctly. You are saying the SP will return a recordset - that usually means a table structure. You are also using an OUT parameter. AFAIK, u can't have a procedure returning both.
So what does rs contain ? It is possible that rs contains nothing (out params are not returned as recordsets).

Hi RROCKET !
Please do open the recordset.

Rupam

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.