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

ASP排序问题有待解决

DCQZ 发布于 2010-08-07 12:43, 548 次点击
下面代码这里sql1="Select * From "&DataFrom&" where SortID="&sID&" and ID<"&ID&"order by ID asc"
当我使用order by ID asc的话就每法显示出来,不使用的话就可以显示“上一张”

function CGMenuImg1(DataFrom,ID,sID)
  dim rs1,sql1
  dim n
  n=1
  
 Set rs1=server.CreateObject("adodb.recordset")
  sql1="Select * From "&DataFrom&" where SortID="&sID&" and ID<"&ID&"order by ID asc"
  rs1.open sql1,conn,1,1
  while not rs1.eof and n<2
    response.Write "<a href=""#"" onclick=""javascript:window.open('OOpen.asp?ID="&rs1("ID")&"&sortID="&sID&"','newwindow','toolbars=0, location=0,statusbars=0,menubars=0,width=700,height=550,scrollbars=1 ,left=320,top=800')"">上一张</a>"
    n=n+1
    rs1.movenext
    wend
    rs1.close
    set rs1=nothing
end function
3 回复
#2
wangjy5002010-08-07 14:02
sql1="Select * From "&DataFrom&" where SortID="&sID&" and ID<"&ID&"order by ID asc"
前面可能要空 一格。
sql1="Select * From "&DataFrom&" where SortID="&sID&" and ID<"&ID&" order by ID asc"
#3
DCQZ2010-08-09 10:46
回复 2楼 wangjy500
感谢你啊,就是这个问题
#4
funky2010-08-10 12:27
超级无语
1