ASP tips: Simplify creating a closed record set object and creating a simple MSSQL stored procedure Byshawl.qiu
1. Build and create a closed record set function
2. Create a simple MSSQL stored procedure in MSSQL query analyzer
3. Apply steps 1 and 2 in ASP
shawl.qiu
2006-8-26
http://blog.csdn.net/btbtd
1. Build and create a closed record set function
linenum
functioncreateRs(rs)
setrs=createObject("adodb.recordset")
endfunction
functioncloseRs(rs)
rs.close
setrs=nothing
endfunction
2. Create a simple MSSQL stored procedure in MSSQL query analyzer
linenum
createprocdbo.at_sbcat_t1
as
Begin
select*fromctatsbcatorderbysbcat
end
3. Apply steps 1 and 2 in ASP
linenum
<%dimrs
callcreateRs(rs)
Withrs
.open"execdbo.at_sbcat_t1",conn
dountil.eof
response.writers("sbcat")&"<br/>"
.movenext
loop
endwith
callcloseRs(rs)
%>