为什么报错(自己搞定了)
<!--#include file="conn.asp"--><%
day1=1
music=request("music")
m_name=request("m_name")
spname=request("spname")
date1=request("date1")
region=request("region")
classname=request("classname")
date2=request("date2")
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select distinct BellID,SongName,SingerName,SpName,Region,YearMonth,DownloadsNumber from DownloadsData 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 region<>"" then sql=sql&" Region like '%"®ion&"%' AND"
if date1<>"" and date2="" then sql=sql&" YearMonth ='"&date1&"-"&day1&"' AND"
if date2<>"" and date1="" then sql=sql&" YearMonth='"&date2&"-"&day1&"' AND"
if date1<>"" and date2<>"" then sql=sql&" YearMonth >= '"&date1&"-"&day1&"' AND YearMonth <= '"&date2&"-"&day1&"' 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
rs.Open sql,conn,1,1
session("sql")=sql
'response.write sql
'response.End()
If rs.eof And rs.bof Then
response.write "没有查询到内容"
else
redim arr(rs.recordcount)
for i=0 to rs.recordcount-1
arr(i)=rs("BellID")
'response.write arr(i)&"<br>"
rs.movenext
'session("ary")=Filter(arr,"n")
session("ary")=arr
'response.write session("ary")&"<br>"
Next
End If
%>
我在另一个页面得到是这样写的.
<!--#include file="conn.asp"-->
<!--#include file="select.asp"-->
<%
ary=Filter(session("ary"),"n")
ary=join(ary,",")
%>
就是空值,什么也得不到
如果给ary=Filter(session("ary"),"n")删除了
改成
<%
ary=join(session("ary"),",")
%>
会报这样的错
[free]Microsoft VBScript 运行时错误 错误 '800a000d'
类型不匹配: 'Join'
/selectcs.asp,行 12 [/free]
有人知道什么原因吗?怎么改吗
[[it] 本帖最后由 lili0610 于 2008-9-17 16:43 编辑 [/it]]