asp如何给留言板加一个判断,就是当记录集为空的时候显示什么?

显示ASP如何给留言板加一个判断,就是当记录集为空的时候显示什么,我现在的情况是当记录集为空的时候该页无法显示!<%page=cint(Request.QueryStri... 显示ASP如何给留言板加一个判断,就是当记录集为空的时候 显示什么,我现在的情况是当记录集为空的时候 该页无法显示!
<%

page=cint(Request.QueryString("page"))
write1=Trim(Request.QueryString("write1"))
caozuo=Trim(Request.QueryString("caozuo"))
caozuoid=Trim(Request.QueryString("caozuoid"))
default1=Trim(Request.QueryString("default1"))
ID=Trim(Request.QueryString("id"))
action=Trim(Request.QueryString("action"))
if action<>"" And action="delete" then
sql="delete from leaveword where [ID]="&ID
conn.Execute sql
Response.Redirect "admin_liuyan.asp"
end if
if caozuo<>"" And caozuo="ok" then
if write1<>"" And write1="1" then
sql="Update [leaveword] set [write]=False where [ID]="&caozuoid
conn.Execute sql
Response.Redirect "admin_liuyan.asp?page="&page&""
end if
if write1<>"" And write1="0" then
sql="Update [leaveword] set [write]=True where [ID]="&caozuoid
conn.Execute sql
Response.Redirect "admin_liuyan.asp?page="&page&""
end if
if default1<>"" And default1="1" then
sql="Update [leaveword] set [default]=false where [ID]="&caozuoid
conn.Execute sql
Response.Redirect "admin_liuyan.asp?page="&page&""
end if
if default1<>"" And default1="0" then
sql="Update [leaveword] set [default]=True where [ID]="&caozuoid
conn.Execute sql
Response.Redirect "admin_liuyan.asp?page="&page&""
end if

end if

if action="replyok" then
num=Trim(Request.Form("pagenum"))
reply=Trim(Request.Form("reply"))
replytime=now()

set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from reply where replyid="&id
rs.open sql,conn,1,3
if rs.bof And rs.eof then
set rsr=Server.CreateObject("ADODB.Recordset")
sqlr="select * from reply"
rsr.open sql,conn,1,3
rsr.addnew
rsr("reply")=reply
rsr("replyid")=id
rsr("replytime")=replytime
rsr.update
rsr.close
set rsr=nothing
response.redirect("admin_liuyan.asp?page="&num)
else
rs("reply")=reply
rs("replyid")=id
rs("replytime")=replytime
rs.update
rs.close
set rs=nothing
response.redirect("admin_liuyan.asp?page="&num)
end if
end if

%>
这是部分代码
展开
 我来答
若以下回答无法解决问题,邀请你更新回答
火也快乐
推荐于2016-02-12 · 超过75用户采纳过TA的回答
知道小有建树答主
回答量:183
采纳率:0%
帮助的人:140万
展开全部
试试:<%

page=cint(Request.QueryString("page"))
write1=Trim(Request.QueryString("write1"))
caozuo=Trim(Request.QueryString("caozuo"))
caozuoid=Trim(Request.QueryString("caozuoid"))
default1=Trim(Request.QueryString("default1"))
ID=Trim(Request.QueryString("id"))
action=Trim(Request.QueryString("action"))
if action<>"" And action="delete" then
sql="delete from leaveword where [ID]="&ID
conn.Execute sql
Response.Redirect "admin_liuyan.asp"
end if
if caozuo<>"" And caozuo="ok" then
if write1<>"" And write1="1" then
sql="Update [leaveword] set [write]=False where [ID]="&caozuoid
conn.Execute sql
Response.Redirect "admin_liuyan.asp?page="&page&""
end if
if write1<>"" And write1="0" then
sql="Update [leaveword] set [write]=True where [ID]="&caozuoid
conn.Execute sql
Response.Redirect "admin_liuyan.asp?page="&page&""
end if
if default1<>"" And default1="1" then
sql="Update [leaveword] set [default]=false where [ID]="&caozuoid
conn.Execute sql
Response.Redirect "admin_liuyan.asp?page="&page&""
end if
if default1<>"" And default1="0" then
sql="Update [leaveword] set [default]=True where [ID]="&caozuoid
conn.Execute sql
Response.Redirect "admin_liuyan.asp?page="&page&""
end if

end if

if action="replyok" then
num=Trim(Request.Form("pagenum"))
reply=Trim(Request.Form("reply"))
replytime=now()

set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from reply where replyid="&id
rs.open sql,conn,1,3
if rs.bof And rs.eof then
set rsr=Server.CreateObject("ADODB.Recordset")
sqlr="select * from reply"
rsr.open sql,conn,1,3
rsr.addnew
rsr("reply")=reply
rsr("replyid")=id
rsr("replytime")=replytime
rsr.update
rsr.close
set rsr=nothing
response.redirect("admin_liuyan.asp?page="&num)
else
rs.update("reply")=reply
rs.update("replyid")=id
rs.update("replytime")=replytime
rs.update
rs.close
set rs=nothing
response.redirect("admin_liuyan.asp?page="&num)
end if
end if

%>
追问
情况依旧·你可以留一下QQ吗,我把这个文件传给你!
追答
QQ:674954904
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式