最新标准校服规格表:asp连接access报错

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/10 11:55:51
<%
if not isempty(request.querystring("key")) then
id=request.querystring("key")
else
id=1
end if
set rs=server.createobject("adodb.recordset")
sql="select * from article where articleid="&id
rs.open sql,conn,1,3
If not(rs.bof and rs.eof) Then
rs("hits")=rs("hits")+1
rs.update
else
response.End
end if
%>
这段程序有问题吗?怎么老报错?
Microsoft JET Database Engine (0x80040E14)
语法错误 (操作符丢失) 在查询表达式 'articleid=' 中。
/anquan/anquan_show.asp, 第 13 行

sql="select * from article where articleid="&id
如果通过了就表示数据库里的ID是数字或者自动编号的
sql="select * from article where articleid='"&id&"'"
如果这个通过了就表示数据库里面的ID是字符型的。

或者是你的那个字段写错了也有可能。

你让他把sql变量打出来看看就知道了
估计id的值有点问题

数据库中的articleid字段是数值型的吗?会不会是字符型的?