关于变量的传递问题??
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!--#include file="hotel.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
@import url("style.css");
-->
</style>
</head>
<%
dim computer_id,pyear,pmonth,pday,ptime,chkok,err
dim rs_preengage,rs_computer,rs_save
'接收预约信息----------------------
computer_id=request.Form("computer_id")
pyear=request.Form("pyear")
pmonth=request.Form("pmonth")
pday=request.Form("pday")
ptime=request.Form("ptime")
%>
<body>
<div align="center">
<table width="706" height="281" border="0" class="table_big">
<tr>
<td valign="top"><div align="center">
<!--#include file="include/head.asp" -->
<%
if not isdate(pyear & "-" & pmonth & "-" & pday) then
err=1
end if
if err=1 then
%>
<%= "<title>出现错误!</title>" %>
<br>
<table width="400" border="0" class="table_small">
<tr>
<td> </td>
</tr>
<tr>
<td class="text_error"><div align="left" class="text_title">输入数据出现错误!</div></td>
</tr>
<tr>
<td class="table_title"> </td>
</tr>
<tr>
<td class="text_error"><div align="left">●可能您输入的日期不正确<br>
●可能您没有提前24小时提出预约</div></td>
</tr>
</table>
<% else %>
<%
set rs_preengage=server.CreateObject("adodb.recordset")
sql= "select * from preengage where computer_id =" & computer_id & " and beginhour =" & ptime
sql = sql & "and pyear= " & pyear & "and pmonth=" & pmonth & "and pday=" & pday
rs_preengage.open sql,hotel_conn,3,2
'判断场地是否已经被预约---------------
if rs_preengage.eof or rs_preengage.bof then
chkok=1
else
chkok=0
end if
'将预约写入数据库--------------
if chkok=1 then
set rs_save=server.CreateObject("adodb.recordset")
sql = "select * from preengage"
rs_save.open sql,hotel_conn,3,2
set rs_computer=server.CreateObject("adodb.recordset")
sql = "select * from computer where computer_id=" & computer_id
rs_computer.open sql,hotel_conn,3,2
rs_save.addnew
rs_save("user_name")=session("user_name")
rs_save("computer_id")=computer_id
rs_save("datetime")=now()
rs_save("cost")=rs_computer("cost")
rs_save("pyear")=pyear
rs_save("pmonth")=pmonth
rs_save("pday")=pday
rs_save("beginhour")=ptime
rs_save.update
rs_save.movelast
%>
<%= "<title>预约成功</title>" %>
<br>
<table width="400" border="0" class="table_small">
<tr>
<td width="199"> </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">请及时使用预约机器,并及时交费</div></td>
</tr>
<tr>
<td class="text"><div align="center">[<a href="index.asp">返回</a>]</div></td>
</tr>
<tr>
<td class="text"> </td>
</tr>
</table>
<% else %>
<%= "<title>预约未被接受!</title>" %>
<br>
<table width="400" 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_error"><div align="left">对不起,该房间在您要求的时间已经被预约,请您预约其他同类房间。</div></td>
</tr>
<tr>
<td class="text_error"> </td>
</tr>
</table>
<% End If %>
<% End If %>
<br>
<!--#include file="include/foot.asp" -->
<br>
</div></td>
</tr>
</table>
</div>
</body>
</html>
这段代码执行后,提示
Microsoft JET Database Engine (0x80040E14)
语法错误 (操作符丢失) 在查询表达式 'computer_id = and beginhour =0and pyear= 2010and pmonth=1and pday=1' 中。
/ASP酒店房间预约系统/chkpre.asp, 第 59 行
该如何解决啊!!