我在数据库里输入数据时顺序打乱了,我想在读入页面时,怎么弄可以和我原文件的先后顺序相同呢?该怎么编写那语句,我现在都不知道数据库是按什么顺序读的?
这是里面的一段原文件,不知道是不是从这入手?求个位大侠帮忙看看!!
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编辑过]