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
%>
这是部分代码 展开
<%
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
%>
这是部分代码 展开
若以下回答无法解决问题,邀请你更新回答
1个回答
展开全部
试试:<%
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
%>
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
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询