日期:2014-05-17  浏览次数:21159 次

排序输出问题
<!--#include file="conn.asp"-->
<%
'==================================多选结果============================
sub result(topics,param1,param2,param3,param4,param5,param6)
''response.Write(topics&param1&param2&param3&param4&param5&param6)

  set rs1 = Server.CreateObject( "ADODB.Recordset" )
  sql1="select count("&topics&") as count1 from Result where "&topics&" like '%"&param1&"%'"  
rs1.open sql1,conn,1,3
count1=rs1("count1")
response.Write(count1&"<br>")
' response.Write(sql1&"<br>")
 
set rs2 = Server.CreateObject( "ADODB.Recordset" )
sql2="select count("&topics&") as count2 from Result where "&topics&" like '%"&param2&"%'"  
rs2.open sql2,conn,1,3
count2=rs2("count2")
response.Write(count2&"<br>")
  ' response.Write(sql2&"<br>")
 
set rs3 = Server.CreateObject( "ADODB.Recordset" )
sql3="select count("&topics&") as count3 from Result where "&topics&" like '%"&param3&"%'"  
rs3.open sql3,conn,1,3
count3=rs3("count3")
response.Write(count3&"<br>")
'response.Write(sql3&"<br>")

set rs4 = Server.CreateObject( "ADODB.Recordset" )
sql4="select count("&topics&") as count4 from Result where "&topics&" like '%"&param4&"%'"  
rs4.open sql4,conn,1,3
count4=rs4("count4")
response.Write(count4&"<br>")
'response.Write(sql4&"<br>")

set rs5 = Server.CreateObject( "ADODB.Recordset" )
sql5="select count("&topics&") as count5 from Result where "&topics&" like '%"&param5&"%'"  
rs5.open sql5,conn,1,3
count5=rs5("count5")
response.Write(count5&"<br>")
'response.Write(sql5&"<br>")

set rs6 = Server.CreateObject( "ADODB.Recordset" )
sql6="select count("&topics&") as count6 from Result where "&topics&" like '%"&param6&"%'"  
rs6.open sql6,conn,1,3
count6=rs6("count6")
response.Write(count6&"<br>")
'response.Write(sql6&"<br>")
'call paixu(count1,count2,count3,count4,count5,count6) 
 
 
 
if count1>=count2 and count1>=count3 and count1>=count4 and count1>=count5 and count1>=count6 then 
response.Write(param1)
elseif count2>=count1 and count2>=count3 and count2>=count4 and count2>=count5 and count2>=count6 then
response.Write(param2)
elseif count3>=count1 and count3>=count2 and count3>=count4 and count3>=count5 and count3>=count6 then
response.Write(param3)
elseif count4>=count1 and count4>=count2 and count4>=count3 and count4>=count5 and count4>=count6 then 
response.Write(param4) 
elseif count5>=count1 and count5>=count2 and count5>=count3 and count5>=count4 and count5>=count6 then
response.Write(param5)
elseif count6>=count1 and count6>=count2 and count6>=count3 and count6&g