SoFunction
Updated on 2025-04-08

ASP simplifies creating a closed record set object and creating a simple MSSQL stored procedure

ASP tips: Simplify creating a closed record set object and creating a simple MSSQL stored procedure by

1. Build Create a Close Recordset Function
2. Create a simple MSSQL stored procedure in the MSSQL query analyzer
3. Apply steps 1 and 2 in ASP


2006-8-26
 /btbtd

1. Build Create a Close Recordset Function

linenum 
function createRs(rs) 
    set rs=createObject("") 
end function 

function closeRs(rs) 
         
    set rs=nothing 
end function 

2. Create a simple MSSQL stored procedure in the MSSQL query analyzer

linenum 
create proc dbo.at_sbcat_t1 
as 
begin 
    select * from ctatsbcat order by sbcat 
end 

3. Apply steps 1 and 2 in ASP

linenum 

<%        dim rs 
    call createRs(rs) 
        with rs 
            .open "exec dbo.at_sbcat_t1",conn 
            do until .eof 
                 rs("sbcat")&"<br/>" 
                .movenext 
            loop 
        end with 
    call closeRs(rs) 
%>