代码执行不完就停下了,请大哥大姐近来帮忙看看!

arongit 2005-06-03 10:25:54
<!--#include file="conn.asp"--><%
dim rcerno,rname,rfloor,rno,rarea,rprice,sdate,edate
rcerno=trim(request("rcerno"))
rname=trim(request("rname"))
rfloor=trim(request("rfloor"))
rno=trim(request("rno"))
rarea=trim(request("rarea"))
rprice=trim(request("rprice"))
sdate=trim(request("sdate"))
edate=trim(request("edate"))
%>


<%if "rcerno"="" then
'只没有户主的房屋信息

set rs=server.createobject("adodb.recordset")
sql="select * from room where rname='"&rname&"' and rfloor='"&rfloor&"' and rno='"&rno&"'"
rs.open sql,conn,1,3
%><%if not rs.eof then
response.write "房屋信息已存在"

%><br><a href=add_room.asp.asp target="_blank" >返回重新填写</a><%
else

rs.addnew
rs("rcerno")=rcerno
rs("rname")=rname
rs("rfloor")=rfloor
rs("rno")=rno
rs("rarea")=rarea
rs("rprice")=rprice
rs("sdate")=sdate
rs("edate")=edate
rs.update
rs.close
set rs=nothing
response.redirect "add_roomw.asp"
end if
'没有户主的房屋信息录入完毕
'以下开始录入已有户主的房屋信息
else
set rs=server.createobject("adodb.recordset")
sql="select * from master where cerno='"&rcerno&"'"
rs.open sql,conn,1,3
%><%if not rs.eof then
response.write "信息不存在"

response.end
end if
%><% set rs=server.createobject("adodb.recordset")
sql="select * from room where rname='"&rname&"' and rfloor='"&rfloor&"' and rno='"&rno&"'"
rs.open sql,conn,1,3
%><%if not rs.eof then
response.write "房屋信息已存在返回重新填写"
response.end
rs.addnew
rs("rcerno")=rcerno
rs("rname")=rname
rs("rfloor")=rfloor
rs("rno")=rno
rs("rarea")=rarea
rs("rprice")=rprice
rs("sdate")=sdate
rs("edate")=edate
rs.update
rs.close
set rs=nothing
response.redirect "add_roomw.asp"
end if
end if

%>
也没错误,但是执行不完就停下了,显示空白,请各位指点!
...全文
73 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
公亮 2005-06-03
  • 打赏
  • 举报
回复
纠正一下我刚刚的错误

第3行后面加else可以了

呵呵,不好意思
公亮 2005-06-03
  • 打赏
  • 举报
回复
if not rs.eof then
response.write "房屋信息已存在返回重新填写"
response.end
rs.addnew
rs("rcerno")=rcerno
rs("rname")=rname
rs("rfloor")=rfloor
rs("rno")=rno
rs("rarea")=rarea
rs("rprice")=rprice
rs("sdate")=sdate
rs("edate")=edate
rs.update
rs.close
set rs=nothing
response.redirect "add_roomw.asp"
end if


第3行后面加end if可以了
如果为了程序的健全,就加else,并且在最后加end if
你应该都会的


我分数没有了,也没有办法提问了
帮我多给点
jackycxg 2005-06-03
  • 打赏
  • 举报
回复
再不行的话加我qq:4349142  
不够偶帮你解决问题之外还有一个目的,  分给偶越多越好,呵呵,偶总共100份都没有 

可怜死了
jackycxg 2005-06-03
  • 打赏
  • 举报
回复
<%if not rs.eof then
response.write "信息不存在"

response.end
end if
%>
你这个判断放在这个干什么的?判断户主数据库里有没有该户主存在?
如果你户主存在的花,那么  if not rs.eof then 这个条件就成立了,将执行的是下面的 response.end 语句,,也就是说户主不存在的情况下,程序执行到这里就被  response.end 中断了,当然就不能再运行下去了

自己这判断先想清楚拉。。
arongit 2005-06-03
  • 打赏
  • 举报
回复
谁能帮我解决这个问题我给谁在我的站上打广告!

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧