注册 登录
编程论坛 ASP技术论坛

如何select数据库的clsid=2数据,请各位老师帮忙!

绿洲 发布于 2008-04-07 19:28, 915 次点击
假如我要将数据库clsid=2的数据按顺序查找出来,应该如何实现呢?请大家不吝赐教,谢谢!

 <%rs2.open"select top 6 * from article where clsid=2 &" order by id desc",conn,1,1
                  while not rs2.eof%>
这样写为什么会出错?

我把这clsid=2后面的 order by id desc删掉又可以了,不过不能按时间顺序来排

或者把clsid=2改为clsid="&rs("id")也可以,不过不能识别clsid等于多少?默认等于1
7 回复
#2
madpbpl2008-04-08 01:58
没太看明白
rs2.open"select top 6 * from article where clsid=2 order by id desc",conn,1,1
这样写不行吗?
#3
zfjyyzycl2008-04-08 10:23
rs2.open"select top 6 * from article where clsid=2 &" order by id desc",conn,1,1
这个地方有问题
如果你非要这么写 是不是应该这样写
rs2.open "select top 6 * from article where clsid=2 "&" order by id desc",conn,1,1
#4
fuhuijun2008-04-08 10:35
是啊
应该这样写啊 rs2.open"select top 6 * from article where clsid=2 order by id desc",conn,1,1
#5
绿洲2008-04-14 18:59
rs2.open"select top 6 * from article where clsid=2 order by id desc",conn,1,1

这个写法对了,感谢大家的热心帮助
#6
绿洲2008-04-14 19:02
另再请教一个问题
如想上传到每篇文章的相片以幻灯的形式展现,应如何实现?
如下图这样展示

[[it] 本帖最后由 绿洲 于 2008-4-14 19:05 编辑 [/it]]
#7
yms1232008-04-14 19:11
不知这个是不是楼主想要的。
#8
绿洲2008-04-19 17:16
效果像该网站的一样:www.gxqzfda.
就是想把新闻的图片调出来形成幻灯的效果.
1