Sql record set temp table closing too early?
===

When I run the SQL through SQL Server 2008 it works just fine.  However when I add it to a classic ASP web page and then call it from there it seems to break.  I am not sure what I am missing?

sql = ""

    sql = sql & " DECLARE @listStr VARCHAR(MAX)"

    sql = sql & " DECLARE @temp TABLE ("
    sql = sql & " DistID varchar(30),"
    sql = sql & " FName varchar(30),"
    sql = sql & " LName varchar(30),"
    sql = sql & " RankID int, "
    sql = sql & " PSV int,"
    sql = sql & " ShipCountry varchar(30),"
    sql = sql & " ShipState varchar(30) )"

    sql = sql & " INSERT INTO @temp"
    sql = sql & " EXEC	[dbo].[MSGGetList]"
    sql = sql & " @List = N'" & request("report_type") & "',"
    sql = sql & " @DistID = " & Session("DistributorID") & ","
    sql = sql & " @BusCtrID = 1,"

    ' Autoship Filter Params
    If request("autoship") <> "" Then
        sql = sql & " @FilterAutoship = '" & request("autoship") & "',"
    Else
        sql = sql & " @FilterAutoship = NULL,"
    End If

    sql = sql & " @ItemID = " & request("item_id") & ","

    ' Order Filter Params
    If request("orders") <> "" Then
        sql = sql & " @Orders = '" & request("orders") & "',"
    Else
        sql = sql & " @Orders = NULL,"
    End If

    If request("minvol") <> "" Then
        sql = sql & " @MinVol = " & request("minvol") & ","
    Else
        sql = sql & " @MinVol = NULL,"
    End If

    If request("minpostamt") <> "" Then
        sql = sql & " @MinPostAmt = " & request("minpostamt") & ","
    Else
        sql = sql & " @MinPostAmt = NULL,"
    End If

    If request("startdate") <> "" Then
        sql = sql & " @DateStart = '" & request("startdate") & "',"
    Else
        sql = sql & " @DateStart = NULL,"
    End If

    If request("enddate") <> "" Then
        sql = sql & " @DateEnd = '" & request("enddate") & "',"
    Else
        sql = sql & " @DateEnd = NULL,"
    End If

    ' Location Filter Params
    If request("country") <> "" Then
        sql = sql & " @Country = '" & request("country") & "',"
    Else
        sql = sql & " @Country = NULL,"
    End If

    If request("region") <> "" Then
        sql = sql & " @Region = '" & request("region") & "',"
    Else
        sql = sql & " @Region = NULL,"
    End If
    
    ' Rank Filter Params
    If request("rankid") <> "" Then
        sql = sql & " @RankID = '" & request("rankid") & "',"
    Else
        sql = sql & " @RankID = NULL,"
    End If

    'Do Not send list
    If request("DoNotSend") <> "" Then
        sql = sql & " @Exempt = '" & request("DoNotSend") & "',"
    End If

    ' Volume Filter Params
    sql = sql & " @MinPV = " & request("min_pv") & ","
    sql = sql & " @MaxPV = " & request("max_pv") & ","
    sql = sql & " @MinGV = " & request("min_gv") & ","
    sql = sql & " @MaxGV = " & request("max_gv") & ","
    sql = sql & " @MinLBVRBV = NULL"
    sql = sql & " SELECT @listStr = COALESCE(@listStr+',' ,'') + DistID FROM @temp"
	sql = sql & " SELECT @listStr AS ToList"
    stop
    response.write(sql & "<br />")
    Set rsToList = GetRecordSet(sql)

    
    response.Write(rsToList("ToList"))

When I step through the code and look at rsToList it says:

Operation not allowed when object is closed

Any idea what I am missing here ?!