| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 805 人关注过本帖
标题:FROM 子句语法错误
只看楼主 加入收藏
leafboy
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2006-2-16
收藏
 问题点数:0 回复次数:2 
FROM 子句语法错误

<%sub down_body()
dim keyword,class_id,colname,totalsoft,Currentpage,totalpages,i
keyword=request("keyword")
cat_id=request("cat_id")
class_id=request("class_id")
colname=request("colname")

sql="SELECT * FROM soft order by soft_joindate desc"
if cat_id<>"" and class_id="" then
sql="SELECT * FROM soft soft_catid="&cat_id&" order by soft_joindate desc"
elseif class_id<>"" and keyword="" then
sql="SELECT * FROM soft soft_classid="&class_id&" order by soft_joindate desc"
elseif keyword<>"" and colname<>"0" then
sql="select * from soft "&colname&" like '%"&keyword&"%' order by soft_joindate desc"
elseif keyword<>"" and colname="0" then
sql="select * from soft soft_name like '%"&keyword&"%' or soft_desc like '%"&keyword&"%' order by soft_joindate desc"
else
sql="SELECT * FROM soft order by soft_joindate desc"
end if

set rssoft=server.createobject("adodb.recordset")
rssoft.open sql,conn,1,1
%>


错误类型:
Microsoft JET Database Engine (0x80040E14)
FROM 子句语法错误。
/aaaa/inc/down_body.asp, 第 22 行

怎么处理啊?紧急,在线等

搜索更多相关主题的帖子: 子句 FROM 语法 
2006-02-19 09:28
dennis
Rank: 1
等 级:新手上路
帖 子:102
专家分:0
注 册:2006-2-17
收藏
得分:0 
有条件的话必须用where的
sql="select * from 表名 where 条件"
2006-02-19 12:39
conn
Rank: 2
等 级:新手上路
威 望:5
帖 子:420
专家分:0
注 册:2005-11-27
收藏
得分:0 
sql="SELECT * FROM soft order by soft_joindate desc"
if cat_id<>"" and class_id="" then
sql="SELECT * FROM soft where soft_catid="&cat_id&" order by soft_joindate desc"
elseif class_id<>"" and keyword="" then
sql="SELECT * FROM soft where soft_classid="&class_id&" order by soft_joindate desc"
elseif keyword<>"" and colname<>"0" then
sql="select * from soft where "&colname&" like '%"&keyword&"%' order by soft_joindate desc"
elseif keyword<>"" and colname="0" then
sql="select * from soft where soft_name like '%"&keyword&"%' or soft_desc like '%"&keyword&"%' order by soft_joindate desc"
else
sql="SELECT * FROM soft order by soft_joindate desc"
end if

我是新手,但我很虚心,对我发的问题请不要取笑,谢谢
2006-02-19 12:47
快速回复:FROM 子句语法错误
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.047786 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved