dede权限设置:求助一段ASP程序

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/26 09:08:01
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>查看内容</title>
<!--#include file="conn.asp"-->
</head>
<body>
<%id=request.querystring("id")%>
<%set showme=conn.execute("select * from index where id ="&id&"")%>
<p><a href="index.asp">返回首页</a>
<br><a href="say.asp">发表帖子</a>
<p>
<table cellpadding="0" cellspacing="1" border="0" align="center" width="80%" bgcolor="#000000">
<tr>
<td bgcolor="#FFFFFF" rowspan="2" width="20%" height="100" style = "word-break:break-all">姓名:<%=showme("name")%></td>
<td bgcolor="#FFFFFF" width="80%" height=10 style = "word-break:break-all">标题:<%=showme("title")%></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" width="80%" height="90" style = "word-break:break-all"><%=showme("body")%></td>
</tr>
</table>
<%set showme=nothing%>
</body>
</html>

报错:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 'id =' 中。
/show.asp, 第 11 行

***************************************************
第 11 行为:<%set showme=conn.execute("select * from index where id ="&id&"")%>
********************************************
ID没取到值?不对吧?
<%id=request.querystring("id")%> 就是对地址栏里取ID值

index应该是保留字
<%set showme=conn.execute("select * from [index] where id ="&id)%>用括号括上

ID本身是数字类型吧?
直接这么写就可以

ID值没有传过来,是一个空值,才造成这种错误!
检查传值吧!

:<%set showme=conn.execute("select * from index where id ="&id)%>

ID没有取到值。