怎样解决语法错误 (操作符丢失) 在查询表达式 'userid=' 中
ifRequest.Form("hid")<>""thensql1="selectmax(returntime)asmaxtimefromborrowinfowhereu...
if Request.Form("hid")<>"" then sql1="select max(returntime) as maxtime from borrowinfo where userid="&session("user")&"" set rs1=conn.execute(sql1) sql2="select title from readerinfo where userid="&session(user)&"" set rs2=conn.execute(sql2) sql3="select num,term from readerterm where identity='"&rs2("title")&"'" set rs3=conn.execute(sql3) sql4="select count(*) from borrowinfo where userid="&session(user)&"" set rs4=conn.execute(sql4) if rs1("maxtime") Response.Redirect "borrow.asp?comm=已借图书超期,不能借书!" else if rs4(0)=rs3("num") then Response.Redirect "borrow.asp?comm=已借满图书,不能再借书!" else book_id=request.form("book_id") present=date() tpresent=dateadd("d",rs3("term"),present) sql5="insert into borrowinfo(userid,bookid,bookname,borrowtime,returntime)" sql5=sql5&"values("&id&","&bookid&",'"&bookname&"','"&present&"','"&tpresent&"')" conn.execute(sql5) sql6="update bookinfo set base='否'where bookid='"&session(user)&"'" Response.Redirect "borrow.asp?comm=此书已借!" end if end if end if%> 浏览器问题: 错误类型: Microsoft JET Database Engine (0x80040E14) 语法错误 (操作符丢失) 在查询表达式 'userid=' 中。 /tsgl/borrow.asp, 第 108 行 浏览器类型: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) 网页: POST 40 ??? /tsgl/borrow.asp POST Data: book_id=32313&hid=ok&Submit=%BD%E8%CA%E9 问题: 1.此代码编写是否正确(是借书时候验证是否超期和已经借满)? 2.浏览器中出现的问题 谢谢!
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询