主题:  提示记录被删除。????这段代码错在哪?

huhui_5d

职务:普通成员
等级:1
金币:0.0
发贴:3
#12005/4/27 2:47:23
错误类型:
Microsoft JET Database Engine (0x80040E23)
记录被删除。
change.asp, 第 4 行

<!-- #include file="../pathdb.inc" -->
<%if request("n")=1 then
sub indate()
rs("hotelname")=t2
rs("roomtype")=t3
rs("conprice")=t4
rs("price")=t5
rs("userprice")=t6
rs("breakfast")=d
rs("weekendprice")=t7
rs("feastprice")=t8
rs("StartDate")=StartDate
rs("EndDate")=EndDate
rs("remark")=remark
rs("payment")=d2
rs("InnerRemark")=InnerRemark
end sub

t2=replace(request("t2"),"'","’")
t2=replace(t2,"<","〈")
t2=replace(t2,">","〉")
t3=replace(request("t3"),"'","’")
t3=replace(t3,"<","〈")
t3=replace(t3,">","〉")
t4=request("t4")
t5=request("t5")
t6=request("t6")
t7=request("t7")
t8=request("t8")
d=request("d")
d1=request("d1")
d2=request("d2")
if d2="" then
d2=3
end if
StartDate=request("t9")
EndDate=request("t10")
remark=replace(request("s"),"'","’")
remark=replace(remark," "," ")
remark=replace(remark,vbCrLf,"<br>")
InnerRemark=replace(request("s1"),"'","’")
InnerRemark=replace(InnerRemark," "," ")
InnerRemark=replace(InnerRemark,vbCrLf,"<br>")

if d1="True" then
sql="select * from roominfo where roomcode="& request("id")
set rs1=conn.execute(sql)
if rs1("setup")=false then'------------------------setup=false
sql="select * from roominfo where setup=true"
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
num=rs2.RecordCount
rs2.close
set rs2=nothing
if num>9 then
sql="select * from roominfo where setup=true and num>9"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
while not rs.eof
rs("setup")=false
rs.update
rs.movenext
wend
rs.close
num=9
end if
sql="select * from roominfo where roomcode="& request("id") &""
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
indate
rs("setup")=d1
rs("num")=num+1
rs.update
num=rs("num")
rs.close
h=1
else '-----------------------------------------------setup=true
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
indate
rs.update
rs.close
h=1
end if
rs1.close
else
sql="select * from roominfo where roomcode="& request("id")
set rs1=conn.execute(sql)
if rs1("setup")=false then'------------------------setup=false
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
indate
rs.update
rs.close
h=1
else'-----------------------------------------------setup=true
num=rs1("num")
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
indate
rs("setup")=d1
rs("num")=0
rs.update
rs.close
sql="select * from roominfo where num>"&num
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
while not rs.eof
rs("num")=rs("num")-1
rs.update
rs.movenext
wend
rs.close
h=1
end if
rs1.close
set rs1=nothing
end if
end if
%>
<%sql="select * from roominfo where roomcode="&request("id")&""
set rs=conn.execute(sql)%>


<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title></title>

<style type="text/css">
<!--
a { font-family: "新细明体"; font-size: 10pt; color: #000000; text-decoration: none}
a:hover { font-family: "新细明体"; font-size: 10pt; color: #FF3300; text-decoration: underline}
table { font-family: "新细明体"; font-size: 10pt; color: #000000}
body { font-family: "新细明体"; font-size: 10pt; color: #000000}

-->
</style>
<script Language="javascript"><!--
function check(theForm)

{

if (theForm.t2.value=="")
{
alert("请在酒店名称域中输入值。");
theForm.t2.focus();
return (false);
}
if (theForm.t2.value.length > 50)
{
alert("在酒店名称域中,请最多输入50个字。");
theForm.t2.focus();
return (false);
}

if (theForm.t3.value == "")
{
alert("请在客房类型域中输入值。");
theForm.t3.focus();
return (false);
}

if (theForm.t4.value=="")
{
alert("请在合同价域中输入值。");
theForm.t4.focus();
return (false);
}
if (theForm.t4.value.length>20)
{
alert("在合同价域中,请最多输入20个字");
theForm.t4.focus();
return (false);
}
var checkOK = "0123456789.";
var checkStr = theForm.t4.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch == ".")
{
allNum += ".";
decPoints++;
}
else
allNum += ch;
}
if (!allValid)
{
alert("在合同价域中,只能输入数字字符。");
theForm.t4.focus();
return (false);
}

if (decPoints > 1)
{
alert("请在合同价域中输入一个有效数字。");
theForm.t4.focus();
return (false);
}

if (theForm.t5.value == "")
{
alert("请在挂牌价域中输入值。");
theForm.t5.focus();
return (false);
}
if (theForm.t5.value.length>20)
{
alert("请在挂牌价域中输入20个以内的字符!");
theForm.t5.focus();
return (false);
}
var checkOK = "0123456789.";
var checkStr = theForm.t5.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch == ".")
{
allNum += ".";
decPoints++;
}
else
allNum += ch;
}
if (!allValid)
{
alert("在挂牌价域中,只能输入数字字符。");
theForm.t5.focus();
return (false);
}

if (decPoints > 1)
{
alert("请在挂牌价域中输入一个有效数字。");
theForm.t5.focus();
return (false);
}

if (theForm.t6.value=="")
{
alert("请在会员价域中输入值。");
theForm.t6.focus();
return (false);
}
if (theForm.t6.value.length>20)
{
alert("请在会员价域中输入20个以内的字符!");
theForm.t6.focus();
return (false);
}
var checkOK = "0123456789.";
var checkStr = theForm.t6.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch == ".")
{
allNum += ".";
decPoints++;
}
else
allNum += ch;
}
if (!allValid)
{
alert("在会员价域中,只能输入数字字符。");
theForm.t6.focus();
return (false);
}

if (decPoints > 1)
{
alert("请在会员价域中输入一个有效数字。");
theForm.t6.focus();
return (false);
}

if (theForm.t7.value.length>20)
{
alert("请在周末价域中输入20个以内的字符!");
theForm.t7.focus();
return (false);
}
var checkOK = "0123456789.";
var checkStr = theForm.t7.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch == ".")
{
allNum += ".";
decPoints++;
}
else
allNum += ch;
}
if (!allValid)
{
alert("在周末价域中,只能输入数字字符。");
theForm.t7.focus();
return (false);
}

if (decPoints > 1)
{
alert("请在周末价域中输入一个有效数字。");
theForm.t7.focus();
return (false);
}

if (theForm.t8.value.length>20)
{
alert("请在节日价域中输入20个以内的字符!");
theForm.t8.focus();
return (false);
}
var checkOK = "0123456789.";
var checkStr = theForm.t8.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch == ".")
{
allNum += ".";
decPoints++;
}
else
allNum += ch;
}
if (!allValid)
{
alert("在节日价域中,只能输入数字字符。");
theForm.t8.focus();
return (false);
}

if (decPoints > 1)
{
alert("请在节日同价域中输入一个有效数字。");
theForm.t8.focus();
return (false);
}
return (true);
}
//--></script>



<%if h=1 then%> <script Language="javascript">
alert("更改成功!")
</script> <%end if%> <%if not rs.eof then%> <form method="post" action="change.asp?n=1" <%if request("k")=1 then%>target="f"<%else%>target="f1"<%end if%> onsubmit="return check(this);">
<table width="100%" border="1" align="center" cellspacing="1" cellpadding="4" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr> <td colspan="5" bgcolor="#CC0000">酒店客房信息更改表〔请在所有的房价中以人民币输入!〕
</td></tr> <tr bgcolor="#FFFAF0"> <td width="15%"> <div align="right">酒店标识</div></td><td width="35%">
<%=rs("hotelcode")%></td><td width="11%"> <div align="right">酒店名称</div></td><td colspan="2" width="39%">
<input type="text" name="t2" size="28" value="<%=rs("hotelname")%>"> </td></tr>
<tr bgcolor="#FFFAF0"> <td width="15%"> <div align="right">客房类型</div></td><td width="35%">
<input type="text" name="t3" size="26" value="<%=rs("roomtype")%>"> </td><td width="11%">
<div align="right">合同价</div></td><td colspan="2" width="39%"> <input type="text" name="t4" size="14" value="<%=rs("conprice")%>">
(人民币)</td></tr> <tr bgcolor="#FFFAF0"> <td width="15%"> <div align="right">挂牌价</div></td><td width="35%">
<input type="text" name="t5" size="14" value="<%=rs("price")%>"> (人民币)</td><td width="11%">
<div align="right">会员价</div></td><td colspan="2" width="39%"> <input type="text" name="t6" size="14" value="<%=rs("userprice")%>">
(人民币)</td></tr> <tr bgcolor="#FFFAF0"> <td width="15%"> <div align="right">早餐</div></td><td width="35%">
<select name="d"> <option value="<%=rs("breakfast")%>"><%=rs("breakfast")%></option>
<option >不含早餐</option> <option >含单早餐</option> <option >含双早餐</option> </select>
</td><td width="11%"> <div align="right">周末价</div></td><td colspan="2" width="39%">
<input type="text" name="t7" size="14" value="<%=rs("weekendprice")%>"> (人民币)</td></tr>
<tr bgcolor="#FFFAF0"> <td height="21" width="15%" align="right">节日价</td><td height="21" width="35%">
<input type="text" name="t8" size="14" value="<%=rs("feastprice")%>"> (人民币) </td><td height="21" align="right" width="11%">特惠酒店</td><td height="21" colspan="2" width="39%">
<select name="d1"> <option value="<%=rs("setup")%>"><%if rs("setup")=True then%>是<%else%>否<%end if%></option>
<option value="False">否</option> <option value="True">是</option> </select>
特惠酒店编号: <%if isnull(rs("num")) then%> <%else%><%=rs("num")%><%end if%></td></tr>
<tr bgcolor="#FFFAF0"> <td height="21" width="15%" align="right">房价有效期</td><td height="21" width="35%">起始日期
<input type="text" name="t9" value="<%=rs("StartDate")%>" size="11">
终止日期
<input type="text" name="t10" value="<%=rs("EndDate")%>" size="11"> </td><td height="21" align="right" width="11%">付款方式</td><td height="21" colspan="2" width="39%">
<%select case rs("payment")
case 1
pay="饭店前台付款"
case 2
pay="预付"
case 3
pay="客户可选择"
end select%> <select name="d2"> <option value="<%=rs("payment")%>"><%=pay%></option>
<option value="1">饭店前台付款</option> <option value="2">预付</option> <option value="3">客户可选择</option>
</select> </td></tr> <tr bgcolor="#FFFAF0"> <td height="21" width="15%" align="right">备注</td><td height="21" colspan="4">
<textarea name="s" cols="66" rows="8"><%=rs("remark")%></textarea> </td></tr>
<tr bgcolor="#FFFAF0"> <td height="21" width="15%" align="right">内部备注</td><td height="21" colspan="4"> <%=rs("InnerRemark")%></td></tr>
<tr bgcolor="#FFFAF0"> <td height="21" width="15%"> <div align="right">修改内部备注</div></td><td height="21" colspan="4">
<textarea name="s1" cols="66" rows="8"><%=rs("InnerRemark")%></textarea> </td></tr>
</table><div align="center">
<input type="hidden" name="id" value="<%=request("id")%>">
<input type="submit" name="Submit" value="确定更改"> <input type="reset" name="Submit2" value="重新输入">
<INPUT TYPE="hidden" NAME="k" value="<%=request("k")%>"></div></form>



<%end if
rs.close
conn.close%>

编辑历史:[此帖最近一次被 huhui 编辑过(编辑时间:2005-04-27 12:06:21)]


死不了

职务:普通成员
等级:1
金币:0.0
发贴:89
#22005/4/27 17:36:41
应该是拼写错误



林易

职务:普通成员
等级:3
金币:1.0
发贴:750
#32005/4/28 10:01:53
你先注释了看,再看数据库中对应字段