求ASP高手改段程序 前台调用:<%=WebContent()%> 后台有10条新闻列表,我要怎么才能调中间的第5条?
<%functionWebContent()dimIDID=request.QueryString("ID")dimrs,sqlsetrs=server.createob...
<%
function WebContent()
dim ID
ID=request.QueryString("ID")
dim rs,sql
set rs = server.createobject("adodb.recordset")
if request.QueryString("ID")="" then
sql="select top 1 ID,AboutName,Source,Content,GroupID,Exclusive,ClickNumber,AddTime from Ameav_pop where ViewFlag and not ChildFlag order by Sequence asc"
else
sql="select ID,AboutName,Source,Content,GroupID,Exclusive,ClickNumber,AddTime from Ameav_pop where ViewFlag and not ChildFlag and ID="&ID
end if
rs.open sql,conn,1,3
if not rs.eof then
if not requestpage=1 then '当前页码不等于1时,向下移动相应的字节数
content=mid(rs("content"),(requestpage-1)*pagenum+1,Sitenum)
else
content=left(rs("content"),Sitenum) '当页码等于1时,截取相应文本
end if
if ViewNoRight(rs("GroupID"),rs("Exclusive")) then
%>
<%=Replace(content,chr(13),"<br>")%>
<%
rs("ClickNumber")=rs("ClickNumber")+1
else
end if
rs.update
rs.close
else
end if
set rs=nothing
end function
%>
调用代码:<%=WebContent()%>
后台有10条新闻列表,我要怎么才能调中间的第5条? 展开
function WebContent()
dim ID
ID=request.QueryString("ID")
dim rs,sql
set rs = server.createobject("adodb.recordset")
if request.QueryString("ID")="" then
sql="select top 1 ID,AboutName,Source,Content,GroupID,Exclusive,ClickNumber,AddTime from Ameav_pop where ViewFlag and not ChildFlag order by Sequence asc"
else
sql="select ID,AboutName,Source,Content,GroupID,Exclusive,ClickNumber,AddTime from Ameav_pop where ViewFlag and not ChildFlag and ID="&ID
end if
rs.open sql,conn,1,3
if not rs.eof then
if not requestpage=1 then '当前页码不等于1时,向下移动相应的字节数
content=mid(rs("content"),(requestpage-1)*pagenum+1,Sitenum)
else
content=left(rs("content"),Sitenum) '当页码等于1时,截取相应文本
end if
if ViewNoRight(rs("GroupID"),rs("Exclusive")) then
%>
<%=Replace(content,chr(13),"<br>")%>
<%
rs("ClickNumber")=rs("ClickNumber")+1
else
end if
rs.update
rs.close
else
end if
set rs=nothing
end function
%>
调用代码:<%=WebContent()%>
后台有10条新闻列表,我要怎么才能调中间的第5条? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询