谁能帮我看下这个ASP代码

来源:百度知道 编辑:UC知道 时间:2024/09/21 22:20:19
我想让商品列表按照发送顺序排列。现在的排列方式是最早发的在第1。我想要最刚发的在第1那种。 怎么改下啊?

strSql = "select p.pkid,p.userId, productName, productPic,oldPrice ,newPrice,oldPrice,VIPPrice,shopName from products p, productType pt,user where p.productTypeId = pt.pkid and p.enabled = true and user.pkid = p.userId and user.enabled = true " & strParam & " order by isTop, isHigh, p.createTime"

rs.open strSql, conn, 1, 3
reqProductTypeId = myRequest("productTypeId")

if not IsEmptyStr(reqProductTypeId) and IsNumeric(reqProductTypeId) then
set cmd = server.CreateObject("ADODB.Command")
set cmd.ActiveConnection = conn
cmd.CommandText = "select classPath from productType where pkid = ?"
cmd.Parameters.Append cmd.CreateParameter("@pkid", 3, 1,, reqProductTypeId)
set rs = cmd.Execute()
strClassPath = Trim(rs("classPath")) & reqProductTypeId & "/"
rs.close()

strP

order by isTop, isHigh, p.createTime"
后面的isTop, isHigh, p.createTime改成你数据库的主键,比如是id的话就改成:order by id desc 注意,后面要加desc表示按降序排列

strSql = "select p.pkid,p.userId, productName, productPic,oldPrice ,newPrice,oldPrice,VIPPrice,shopName from products p, productType pt,user where p.productTypeId = pt.pkid and p.enabled = true and user.pkid = p.userId and user.enabled = true " & strParam & " order by isTop, isHigh, p.createTime"



strSql = "select p.pkid,p.userId, productName, productPic,oldPrice ,newPrice,oldPrice,VIPPrice,shopName from products p, productType pt,user where p.productTypeId = pt.pkid and p.enabled = true and user.pkid = p.userId and user.enabled = true " & strParam & " order by isTop, isHigh, p.createTime desc "