ASP网页数据调用问题

来源:百度知道 编辑:UC知道 时间:2024/05/15 02:29:24
大家帮着看下这段语句有什么问题,怎么老是调不出数据,而显示信息不存在 <%
dim Rs,id,sql
id=Request.Querystring("id")
If id<>"" and not isnumeric(id) then
Response.Write "<script>alert('非法的ID!');this.location.href='showmore.asp';</SCRIPT>"
Response.End
End If
Set Rs=conn.execute("SELECT * FROM [stu] allmessage id="&id)
If Rs.eof then
Response.Write "<script>alert('信息不存在!');this.location.href='showmore.asp';</SCRIPT>"
Response.End
End If
%>
刚才where语句改了,问题是这样

<%
dim Rs,id,sql
id=Request.Querystring("id")
If id<>"" and not isnumeric(id) then
Response.Write "<script>alert('非法的ID!');this.location.href='showmore.asp';</SCRIPT>"
Response.End
End If
Set Rs=conn.execute("SELECT

SELECT * FROM [stu] allmessage id="&id)

怎么没有where 子句?

从数据库中检索行,并允许从一个或多个表中选择一个或多个行或列。虽然 SELECT 语句的完整语法较复杂,但是其主要的子句可归纳如下:

SELECT select_list
[ INTO new_table ]
FROM table_source
[ WHERE search_condition ]
[ GROUP BY group_by_expression ]
[ HAVING search_condition ]
[ ORDER BY order_expression [ ASC | DESC ] ]

可以在查询之间使用 UNION 运算符,以将查询的结果组合成单个结果集。

<%
dim Rs,id,sql
id=Request.Querystring("id")
If id="" then
Response.Write "<script>alert('参数错误!');this.location.href='showmore.asp';</SCRIPT>"
Response.End
else
If id<>"" and not isnumeric(id) then
Response.Write "<script>alert('非法的ID!');this.location.href='showmore.asp';</SCRIPT>"
Response.End
End If
Set Rs=conn.execute("SELECT * FROM [stu] allmessage id="&id)