求一ASP页面(100分)

来源:百度知道 编辑:UC知道 时间:2024/05/30 04:18:47
从上一页面传递过来2个数字(每个数字代表第*条记录)假设2个数字是2,99。123.mdb数据库中的sjjy表的xyjy字段,第2条记录一直加到第99条(2+3+4+5+6+7+……)然后将结果显示出来,这样的页面怎么写?

假设:传过来的变量是tt,值是“2,9”
<%
tt=request("tt")
id=split(tt,",")
id0=cint(id(0))-1
id1=cint(id(1))
idx=id1-id0
xyjy=""
set rst=server.createobject("adodb.recordset")
sql="select * from sjjy"
rst.open sql,conn,1,1
if rst.recordcount>id0 then
rst.move id0
else
'记录不够
end if
n=0
while not rst.eof or n<idx
xyjy=xyjy+rst("xyjy")
n=n+1
rst.movenext
wend
%>
<%=xyjy%>

假设:传过来的是a=2,b=99
<%
id0=cint(request("a"))-1
id1=cint(request("b"))
idx=id1-id0
xyjy=""
set rst=server.createobject("adodb.recordset")
sql="select * from sjjy"
rst.open sql,conn,1,1
if rst.recordcount>id0 then
rst.move id0
else
'记录不够
end if
n=0
while not rst.eof or n<idx