ADODB.Recordset (0x800A0BCD);BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除
错误类型:ADODB.Recordset (0x800A0BCD);BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录;/1/admin_chk.asp, 第 34 行
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="hotel.asp" -->
<!--#include file="include/is_admin.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>预约确认</title>
<style type="text/css">
<!--
@import url("style.css");
-->
</style>
</head>
<body>
<div align="center">
<table width="706" height="281" border="0" class="table_big">
<tr>
<td valign="top"><div align="center">
<!--#include file="include/admin_head.asp" -->
<%
dim preengage_id,rs_preengage,sql,rs_room,rs_cancel,datetime
'接收表单数据------------------
preengage_id=request("preengage_id")
'打开预约据库--------------------
set rs_preengage=server.CreateObject("adodb.recordset")
If preengage_id="" or isnull(preengage_id) Then
'表单数据preengage_id为空,开始显示预约列表--------------
'此处要加入paid = 0条件来列出尚未付款的预约--------------
sql = "select * from preengage where paid = 0"
rs_preengage.open sql,hotel_conn,3,2
rs_preengage.movefirst '把数据库指针移到第一条信息;(/1/admin_chk.asp, 第 34 行)
%>
<br>
<table width="584" border="0" class="table_small">
<tr>
<td colspan="6"> </td>
</tr>
<tr>
<td colspan="6" class="text_title"><div align="left">预约确认</div></td>
</tr>
<tr>
<td colspan="6" class="table_title"> </td>
</tr>
<tr class="text">
<td width="86"><div align="left">预约用户</div></td>
<td width="125" class="text"><div align="left">房间号</div></td>
<td width="89"><div align="left">预约日期</div></td>
<td width="89"><div align="left">预约时间</div></td>
<td width="61"><div align="left">费用</div></td>
<td width="104"><div align="left">操作</div></td>
</tr>
<%
while (not rs_preengage.eof)'当指针未到最后一条记录时执行此循环
%>
<tr class="text">
<td><div align="left"><%= rs_preengage("user_name") %></div></td>
<td class="text">
<div align="left">
<%
set rs_room=server.CreateObject("adodb.recordset")
sql = "select * from room where room_id=" & rs_preengage("room_id")
rs_room.open sql,hotel_conn,3,2
response.Write(rs_room("name"))
rs_room.close
%>
</div></td>
<td><div align="left"><%= rs_preengage("pyear") & "-" & rs_preengage("pmonth") & "-" & rs_preengage("pday") %></div></td>
<td><div align="left"><%= rs_preengage("beginhour") & ":00-" & (rs_preengage("beginhour")+1) & ":00" %></div></td>
<td><div align="left"><%= rs_preengage("cost") %></div></td>
<td><div align="left">[<a href="admin_chk.asp?preengage_id=<%= rs_preengage("preengage_id") %>">确认预约</a>][<a href="chkcancel.asp?preengage_id=<%= rs_preengage("preengage_id") %>">删除</a>]</div></td>
</tr>
<%
rs_preengage.movenext
wend
%>
<tr>
<td colspan="6"> </td>
</tr>
<tr>
<td colspan="6"> </td>
</tr>
</table>
<%
Else
'已提交preengage_id数据,开始更新预约表preengage的paid字段---------
sql = "select * from preengage where preengage_id=" & preengage_id
rs_preengage.open sql,hotel_conn,3,2
'如果预约不存在则提示错误信息------------------
if rs_preengage.eof or rs_preengage.bof then
response.Redirect("error.asp")
response.End()
end if
rs_preengage("paid")=1
rs_preengage.update '刷新数据库
datetime= rs_preengage("pyear") & "-" & rs_preengage("pmonth") & "-" & rs_preengage("pday")
datetime=datetime & " " & rs_preengage("beginhour") & ":00-" & (rs_preengage("beginhour")+1) & ":00"
%>
<br>
<table width="488" border="0" class="table_small">
<tr>
<td> </td>
</tr>
<tr>
<td class="text_title"><div align="left">预约确认成功</div></td>
</tr>
<tr>
<td class="table_title"> </td>
</tr>
<tr>
<td class="text"><div align="left">成功确认ID为<%= rs_preengage("preengage_id") %>的预约,它是在<%= datetime %>的预约,费用为<%= rs_preengage("cost") %>元</div></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<% End If %>
<br>
</div></td>
</tr>
</table>
</div>
</body>
</html>