| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 871 人关注过本帖
标题:求助:数据库排序问题
只看楼主 加入收藏
jybsb
Rank: 1
等 级:新手上路
帖 子:124
专家分:0
注 册:2004-9-12
收藏
 问题点数:0 回复次数:3 
求助:数据库排序问题

我在数据库里输入数据时顺序打乱了,我想在读入页面时,怎么弄可以和我原文件的先后顺序相同呢?该怎么编写那语句,我现在都不知道数据库是按什么顺序读的?

这是里面的一段原文件,不知道是不是从这入手?求个位大侠帮忙看看!!

sub ShowArticle(TitleLen) if TitleLen<0 or TitleLen>200 then TitleLen=50 end if if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if end if if currentPage=1 then sqlArticle="select top " & MaxPerPage else sqlArticle="select " end if

sqlArticle=sqlArticle & " ArticleID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,DefaultPicUrl,UpdateTime,Hits,chandi,danwei,danjia from Product where Passed=True " if BigClassName<>"" then sqlArticle=sqlArticle & " and BigClassName='" & BigClassName & "' " if SmallClassName<>"" then sqlArticle=sqlArticle & " and SmallClassName='" & SmallClassName & "' " end if else if SpecialName<>"" then sqlArticle=sqlArticle & " and SpecialName='" & SpecialName & "' " end if end if sqlArticle=sqlArticle & " order by articleid desc" Set rsArticle= Server.CreateObject("ADODB.Recordset") rsArticle.open sqlArticle,conn,1,1 if rsArticle.bof and rsArticle.eof then response.Write("<br><li>没有任何产品</li>") else if currentPage=1 then call ArticleContent(TitleLen) else if (currentPage-1)*MaxPerPage<totalPut then rsArticle.move (currentPage-1)*MaxPerPage dim bookmark bookmark=rsArticle.bookmark call ArticleContent(TitleLen) else currentPage=1 call ArticleContent(TitleLen) end if end if end if rsArticle.close set rsArticle=nothing end sub

[此贴子已经被作者于2004-09-24 11:23:15编辑过]

搜索更多相关主题的帖子: 数据库 
2004-09-24 10:47
jybsb
Rank: 1
等 级:新手上路
帖 子:124
专家分:0
注 册:2004-9-12
收藏
得分:0 

自己先顶了!

斑主尼?


我要阳光 我要开花 我要结果 我要结出苹果 我要砸在牛顿的头上
2004-09-24 10:55
griefforyou
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:3336
专家分:0
注 册:2004-4-15
收藏
得分:0 

Order By 就可以排序


天津网站建设 http://www./
2004-09-24 17:30
jybsb
Rank: 1
等 级:新手上路
帖 子:124
专家分:0
注 册:2004-9-12
收藏
得分:0 

谢谢了!我知道了!


我要阳光 我要开花 我要结果 我要结出苹果 我要砸在牛顿的头上
2004-09-25 09:27
快速回复:求助:数据库排序问题
数据加载中...
 
   



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

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