sql提示:语法错误 (操作符丢失) 在查询表达式 '[id]<7order by [id] desc' 中。
<%dim vid,action
vid=cint(request.QueryString("id"))
dim conn
set conn = server.CreateObject("ADODB.Connection")
conn.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("photo.mdb")
conn.open
dim strsql
if request("action")="left" then
strsql="select TOP 1 * from photo where [id]<" & vid & "order by [id] desc"
elseif request("action")="right" then
strsql="select TOP 1 * from photo where [id]>" & vid &"order by [id] asc"
else
strsql="select * from photo where id=" & vid
end if
dim rs
set rs = server.CreateObject("ADODB.RecordSet")
rs.open strsql,conn,3
If rs.EOF Then
Response.Write "<script type='text/javascript'>alert('对不起,您越界了!');window.history.go(-1);</script>"
rs.Close
Set rs = Nothing
conn.Close
Set rs = Nothing
Response.End
End If
%>
达到的功能是浏览图片,通过点击图片按钮,进行察看