<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>高级查询结果</title>
</head>
<body bgcolor="#0099CC" text="#000000" background="IMAGES/CINMS.GIF">
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=4 width='100%' borderColorLight=#aaaaaa border=1">
<%
wyear=request.form("年")
wmon=request.form("月")
wday=request.form("日")
wsite=request.form("TID")
wcond=request.form("condition")
wcl=request.form("处理人")
wcom=request.form("客户名称")
Response.Write wyear
Response.Write wmon
Response.Write wday
Response.Write wsite
Response.Write wcond
Response.Write wcl
Response.Write wcom
Set rs = Server.CreateObject ("ADODB.Recordset")
sql="Select * from gzhz where 年="&wyear&""
if wmon<>"请选择" then
sql=sql&" and 月="&wmon&""
end if
if wday<>"请选择" then
sql=sql&" and 日="&wday&""
end if
if wsite<>"请选择" then
sql=sql&" and (TID1='"&wsite&"' or TID2='"&wsite&"')"
end if
if wcond<>"请选择" then
sql=sql&" and condition='"&wcond&"'"
end if
if wcom<>"请选择" then
sql=sql&" and 客户名称='"&wcom&"'"
end if
rs.Open sql,conn,1,2
%>
<% dim gzcount
gzcount=rs.RecordCount %>
<tr bgcolor=#006c6c>
<td colspan=<%=rs.Fields.Count+1 %>.><%Response.Write "<b><font color=white>共"&gzcount&"条纪录 当前时间"&CStr(now)&"</font></b>"%></td>
</tr>
<tr bgcolor="#ffffaf">
<%
for i=0 to rs.Fields.Count-24
Response.Write "<td align=center nowrap><font size=2>ID号</font></td>"
Next
FOR i=1 to rs.Fields.Count-23
Response.Write "<td align=center nowrap><font size=2>开始日期</font></td>"
Next
FOR i=2 to rs.Fields.Count-22
Response.Write "<td align=center nowrap><font size=2>结束日期</font></td>"
Next
FOR i=3 to rs.Fields.Count-21
Response.Write "<td align=center nowrap><font size=2>发生时间段</font></td>"
Next
FOR i=11 to rs.Fields.Count-13
Response.Write "<td align=center nowrap><font size=2>"&Ucase(rs(i).Name)&"(分钟)</font></td>"
Next
FOR i=12 to rs.Fields.Count-1
Response.Write "<td align=center nowrap><font size=2>"&Ucase(rs(i).Name)&"</font></td>"
Next
%>
</tr>
<%
'输出内容
Do While NOT rs.EOF
Response.Write "<tr>"
for i=0 to rs.Fields.Count-24
Response.Write "<td align=center nowrap><font size=2>"&Ucase(rs(i).Value)&"</font></td>"
Next
FOR i=1 to rs.Fields.Count-23
Response.Write "<td align=center nowrap><font size=2>"&Ucase(rs(1).Value&"-"&rs(2).Value&"-"&rs(3).Value)&"</font></td>"
Next
FOR i=2 to rs.Fields.Count-22
Response.Write "<td align=center nowrap><font size=2>"&Ucase(rs(4).Value&"-"&rs(5).Value&"-"&rs(6).Value)&"</font></td>"
Next
FOR i=3 to rs.Fields.Count-21
Response.Write "<td align=center nowrap><font size=2>"&Ucase(rs(7).Value&":"&rs(8).Value&"-"&rs(9).Value&":"&rs(10).Value)&"</font></td>"
Next
FOR i=11 to rs.Fields.Count-1
Response.Write "<td align=center nowrap><font size=2>"&rs(i).Value&"</font></td>"
Next
rs.MoveNext
Response.Write "</tr>"
Loop
Response.Write"</table>"
%>
<%
rs.close
Set rs = Nothing
conn.close
set conn=Nothing
%>
</body>
</html>
这是整个程序了,我实在是找不出有什么问题了,大虾给检查检查吧!我用Response.Write wyear检查了,表单能正确传递过来的!