asp 至少一个参数未被指定

来源:百度知道 编辑:UC知道 时间:2024/05/21 11:09:12
错误类型:
Microsoft JET Database Engine (0x80040E10)
至少一个参数没有被指定值。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>贡井之窗</title>
<!--#include file="conn.asp"-->
<%
sql="select * from dataa where name="&request.querystring("id")
set rs=conn.execute(sql)
%>
</head>
<body>
<table align="center" border="1" width="90%" height="90%">
<tr>
<td>
<a href="">时政</a>>><a href="">时政专题</a>>><a href="index.asp">社会主义荣辱观</a>>><a href=""><%=rs("name")%></a>
</td>
</tr>
<tr>
<td>
<% =rs("content") %>
<% conn.close %>
</td&

sql="select * from dataa where name="&request.querystring("id")

这一句有问题,

name是什么类型的??

如果是数字的话,就可以这样写,如果是文本的话!得加定界符''
还有,如果是数字,还得保证 request.querystring("id")不为空,如果为空时,也会出错,原因是得到sql为:
"select * from tablename where fieldname="

而你的错误应该是没有该字段,在查询时就这样显示!

sql="select * from dataa where [name]="&request.querystring("id")

如果name字段是文本或备注:
sql="select * from dataa where [name]='"&request.querystring("id") &"'"