男士风衣打结方法图解:语法错误 (操作符丢失) 在查询表达式 'UserID=' 中。

来源:百度文库 编辑:高考问答 时间:2024/05/03 01:59:07
错误类型:
Microsoft JET Database Engine (0x80040E14)
语法错误 (操作符丢失) 在查询表达式 'UserID=' 中。
/coo/jszx.asp, 第 621 行

浏览器类型:

<tr align="right">
<%
sql="select * from [User] where UserID="&Session("UserId") //第 621 行

set tmprs=conn.execute(sql)
if not tmprs.eof and not tmprs.bof then
Session("UserEmail")=tmprs("UserEmail")
Session("UserTel")=tmprs("UserTel")
end if

Session("UserId")

Session
是有时间限制的,超出时间就自动清除了
建议在此查询前加入
Session
有效性判断如

UserID=session("UserID")
If UserID="" or IsNull(UserID) Then
Response.Write ("<script>alert(' 操作错误 \n\n 可能您还没有登陆或者登陆超时 ');history.back();</script>")
Response.End
End If