参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突

h6252996 2013-12-20 02:11:37

代码如下 我用2013 12 月分能正常查询显示 选择其他就出现“参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突” 请大神们看看 指点指点
<!-- #include file="config.asp" -->
<!-- #include file="functions.asp" -->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/style.css">
<script src="calendar.js"></script>
<title>日志管理</title>
<script type="text/javascript" src="../js/common.js"></script>
<body >

<table border="0" cellpadding="0" cellspacing="0" width="98%" align="center" style="font-size: 12px;">
<tr>
<td colspan="3" style="background: url(/mis/images/serach_term_top_center.gif); background-repeat: repeat-x;"
height="28px">
<div style="background: url(/mis/images/serach_term_top_left.gif); background-repeat: no-repeat;
float: left; height: 28px; width: 231px;">
<span style="margin-left: 35px; height: 28px; line-height: 28px; font-weight: bold;">
查询条件</span></div>
<div style="background: url(/mis/images/serach_term_top_right.gif); background-repeat: no-repeat;
float: right; height: 28px; width: 10px; background-position: bottom">
</div>
</td>
</tr>
<tr>
<td style="background: url(/mis/images/serach_term_middle_left.gif); background-repeat: repeat-y;
background-position: left;" width="1%">
<img src="/mis/images/pline.gif" width="8px" height="1px">
</td>
<td height="50" align="center" style="background: url(/mis/images/serach_term_middle_center.gif);"
width="98%">
<form method="post" action="hxlogSearch.asp" name="myform">
<table border="0" align="center">
<tr>
<td>
<select name="selyear" id="selyear">
<option value="2012" >2012
</option>
<option value="2013" >2013
</option>
<option value="2014" >2014
</option>
<option value="2015" >2015
</option>
<option value="2016" >2016
</option>
</select>

<select name="selmonth" id="selmonth">
<option value="1" >1</option>
<option value="2" >2</option>
<option value="3" >3</option>
<option value="4" >4</option>
<option value="5" >5</option>
<option value="6" >6</option>
<option value="7" >7</option>
<option value="8" >8</option>
<option value="9" >9</option>
<option value="10" >10</option>
<option value="11" >11</option>
<option value="12" >12</option>
</select>


<input
type="submit" value="查 询" class="button_60px" onMouseOut="this.style.backgroundPosition = '0 0';"
onmouseover="this.style.backgroundPosition = '0 -21px';">
<input type="hidden" name="lookfor" value="yes">
</td>
</tr>
</table>
</form>
</td>
<td style="background: url(/mis/images/serach_term_middle_right.gif); background-repeat: repeat-y;
background-position: right;" width="1%">
<img src="/mis/images/pline.gif" width="8px" height="1px">
</td>
</tr>
<tr>
<td colspan="3" height="17" style="background: url(/mis/images/serach_term_bottom_center.gif);
background-repeat: repeat-x;">
<div style="background: url(/mis/images/serach_term_bottom_left.gif); background-repeat: no-repeat;
float: left; height: 17px; width: 10px; background-position: left; background-position: top;">
</div>
<div style="background: url(/mis/images/serach_term_bottom_right.gif); background-repeat: no-repeat;
float: right; height: 17px; width: 63px; background-position: right; background-position: top;">
</div>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="98%" align="center" style="font-size: 12px;">
<tr>
<td colspan="3" style="background: url(/mis/images/serach_result_top_center.gif);
background-repeat: repeat-x;" height="28px">
<div style="background: url(/mis/images/serach_result_top_left.gif); background-repeat: no-repeat;
float: left; height: 28px; width: 240px;">
<span style="margin-left: 35px; height: 28px; line-height: 28px; font-weight: bold;">
查询结果</span></div>
<div style="background: url(/mis/images/serach_result_top_right.gif); background-repeat: no-repeat;
float: right; height: 28px; width: 135px; background-position: bottom">
</div>

</td>
</tr>
<tr>
<td style="background: url(/mis/images/serach_result_middle_left.gif); background-repeat: repeat-y;
background-position: left;" width="1%">
<img src="/mis/images/pline.gif" width="8px" height="1px">
</td>
<td height="50" align="center" valign="top" style="background: url(/mis/images/serach_result_middle_center.gif);"
width="98%">
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
<tr>
<td align="center">
日期

</td>
<td>
日志内容
</td>
<td>
录入时间
</td>
</tr>
<%
Dim yeartime,monthtime,userid,logContent,inputTime
userid=request.Cookies("oabusyuserid")
yeartime=request.Form("selyear")
monthtime=request.Form("selmonth")

if isEmpty(yeartime)=true then
yeartime=year(date())
end if

if isEmpty(monthtime)=true then
monthtime=month(date())
end if

Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
conn.open connstr

sql = "select logContent,inputTime from ww_hxlog where userID='"& userid &"' and YEAR(inputTime)='"& yeartime &"' and MONTH(inputTime)='"& monthtime &"'"
rs.open sql,conn,1
response.write sql

PageSize = "10"
if not IsNot(PageSize,"n") then PageSize = DefaultPageSize
rs.pagesize = PageSize
PageCount = rs.PageCount
PageNo = request("PageNo")
if PageNo = "" or CInt(PageNo) < 1 then PageNo = 1
if CInt(PageNo) > PageCount then PageNo = PageCount
rs.absolutepage = PageNo
i = 0
while not rs.eof and i < rs.pagesize
logContent=rs("logContent")
inputTime=rs("inputTime")

if i mod 2 = 0 then
response.write "<tr>"
else
response.write "<tr bgcolor=#EFEFEF>"
end if

%>

<td>
<%=inputTime%>

</td>
<td>
<%=logContent%>
</td>
<td>
<%=inputTime%>
</td>
</tr>

<%
i = i + 1
rs.movenext
wend
rs.close
set rs = nothing
conn.close
set conn = nothing

%>
<tr bgcolor=Silver>
<td colspan="2">

当前<%=PageNO%>/<%=PageCount%>页
<a href="hxlogSearch.asp?PageNo=1&userid=<%=userid%>&yeartime=<%=yeartime%>&monthtime=<%=monthtime%>"> <font face="Webdings"></font>首页</a>
<a href="hxlogSearch.asp?PageNo=<%= PageNo - 1 %>&userid=<%=userid%>&yeartime=<%=yeartime%>&monthtime=<%=monthtime%>"><font face="Webdings"></font>前页</a>
<a href="hxlogSearch.asp?PageNo=<%= PageNo + 1 %>&userid=<%=userid%>&yeartime=<%=yeartime%>&monthtime=<%=monthtime%>"><font face="Webdings"></font>后页</a>
<a href="hxlogSearch.asp?PageNo=<%= PageCount %>&userid=<%=userid%>&yeartime=<%=yeartime%>&monthtime=<%=monthtime%>"><font face="Webdings"></font>末页</a>
</td>
<td colspan="1" align="right">共:<%= i %> 份</td>
</tr>
</table>
<input type="hidden" name="tr_i" id="tr_i" value="">
</td>
<td style="background: url(/mis/images/serach_result_middle_right.gif); background-repeat: repeat-y;
background-position: right;" width="1%">
<img src="/mis/images/pline.gif" width="8px" height="1px">
</td>
</tr>

</table>
<br />
</body>
</html>
...全文
289 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hookee 2013-12-21
  • 打赏
  • 举报
回复
Response.Write sql 放到 rs.open 之前输出看看是不是正确

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧