帮忙找找
[free]<!--#include file="conn.asp"--><%
music=request("music")
m_name=request("m_name")
spname=request("spname")
dcname=request("dcname")
region=request("region")
sql="Select BellID,SongName,SingerName,Price,AvailabilityDate,SpName,DiscCompany,SingType,Region,DownloadsNumber from BellData where"
if music<>"" then sql=sql&" SongName like '%"&music&"%' AND"
if m_name<>"" then sql=sql&" SingerName like '%"&m_name&"%' AND"
if spname<>"" then sql=sql&" SpName like '%"&spname&"%' AND"
if dcname<>"" then sql=sql&" DiscCompany like '%"&dcname&"%' AND"
if singtype<>"" then sql=sql&" Region like '%"®ion&"%' AND"
if right(sql,5)="WHERE" then sql=left(sql,clng(len(sql))-5) '解决所有参数都为空的情况
if right(sql,3)="AND" then sql=left(sql,clng(len(sql))-3) '去掉参数最后的and
if Other="New" then
sql=sql&" ORDER BY DownloadsNumber DESC"
else
sql=sql&" ORDER BY DownloadsNumber DESC"
end if
session("sql")=sql
else提示这里错误
sql=session("sql")
end if
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql,conn,1,1[/free]
查询方法已经找到,为什么总是提示我ELSE这里错误呢