请教有关ASP查询的问题!

zhl_9932 2005-01-13 08:55:07
各位好:
我今天在做ASP查询的时候遇到一个怪事,我用的机器系统是WIN2003,但我的机器是作为一个普通的客户机,我在我机器上做一个ASP按时间查询的程序,然后把程序放到程序服务器上运行的,服务器的系统是WIN2000.在我的机器上查询结果正常,但是在其他的客户机上都不能把时间的参数传递过来这是怎么回事呀!这段程序中,我用了"告诉浏览器用word来显示文档内容"目的是为了打印.代码如下:
<%response.buffer=true%>
<%response.expires=0%>
<!--#include file="../../inc/config.asp" -->
<% '告诉浏览器用word来显示文档内容
Response.ContentType = "application/msword"
'文档设定
response.AddHeader "content-disposition", "inline; filename=prin.doc"
%>
<%
mz=request.querystring("mz")
usertype=request.querystring("usertype")
bm1=request.querystring("bm")
id0=request.querystring("bm_id")
Set rs=Server.CreateObject("ADODB.RecordSet")
if trim(request.queryString("newsid"))="" then
sqlwhere="where newsid>0"
sqlwhere0="where newsid>0"
if not trim(request.form("time1"))="" and isdate(request.form("time1")) then
sqlwhere=sqlwhere&" and incomedate>=to_date('" & cdate(trim(request.form("time1"))) &"','yyyy-mm-dd')"
sqlwhere0=sqlwhere0&" and incomedate >=to_date('" & cdate(trim(request.form("time1"))) &"','yyyy-mm-dd')"
end if
if not trim(request.form("time2"))="" and isdate(request.form("time2")) then
sqlwhere=sqlwhere&" and incomedate<= to_date('" & cdate(trim(request.form("time2"))) &"','yyyy-mm-dd')"
sqlwhere0=sqlwhere0&" and incomedate<=to_date('" & cdate(trim(request.form("time2"))) &"','yyyy-mm-dd')"
end if
session("sqlwhere0")=sqlwhere0
end if

%>
<html>
<head>
<STYLE type=text/css>BODY TD {
FONT-FAMILY: "宋体"; FONT-SIZE: 12px; LINE-HEIGHT: 20px; TEXT-DECORATION: none
}
A {
COLOR: #000000; FONT-FAMILY: "宋体"; FONT-SIZE: 12px; LINE-HEIGHT: 18px; TEXT-DECORATION: none
}
A:hover {
COLOR: #D95700; FONT-FAMILY: "宋体"; FONT-SIZE: 12px; LINE-HEIGHT: 18px; TEXT-DECORATION: underline
</STYLE>
<title>网络电报</title>
</head>
<body bgcolor="#ffffff" BACKGROUND="images/tbg.gif" LINK="#102179" VLINK="#102179">
<tr> </tr>
<tr>
<td WIDTH="90%" BACKGROUND="images/tbg.gif" VALIGN="top">
<tr>
<td>
<%sqlstr="select Newsid,classid,title,incomedate,comefrom,keystone,ps,affix_title,bm,qs_rq from T_INFO_PUB_NEWS "&sqlwhere&" order by newsid desc"
response.write sqlstr
'rs.CursorType=3
rs.open sqlstr,cn
%>
<p align="center">电 报 登 记 簿</p>

<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000">
<tr bgcolor="#CCCCCC">
<td bgcolor="#FFFFFF" height="21" width="20%">
<div align="center">电报题目</div>
</td>
<td height="21" bgcolor="#FFFFFF" width="14%">
<div align="center">电报字号</div>
</td>
<td height="21" bgcolor="#FFFFFF" width="6%">
<div align="center">等级</div>
</td>
<td height="21" bgcolor="#FFFFFF" width="10%">
<div align="center">发报机关</div>
</td>
<td height="21" bgcolor="#FFFFFF" width="11%">
<div align="center">发报日期</div>
</td>
<td height="21" bgcolor="#FFFFFF" width="21%">
<div align="center">领导批示</div>
</td>
<td height="21" bgcolor="#FFFFFF" width="7%">
<div align="center"> 签收人</div>
</td>
<td height="21" bgcolor="#FFFFFF" width="11%">
<div align="center">签收日期</div>
</td>
</tr>
<%
do while not rs.eof
%>
<tr bgcolor="#FFFFFF">
<td height="19" width="20%"><a href=list_brow.asp?nid=<%=rs("newsid")%>&classid=<%=rs("classid")%>&mz=<%=mz%>&bm=<%=bm1%>&bm_id=<%=id0%>&usertype=<%=usertype%>><%=rs("title")%></a></td>
<td height="19" width="14%"><%=rs("keystone")%></td>
<td height="19" width="6%"><%=rs("affix_title")%></td>
<td height="19" width="10%"><%=rs("comefrom")%></td>
<td height="19" width="11%"><%=rs("incomedate")%></td>
<td height="19" width="21%"><%=rs("ps")%></td>
<td height="19" width="7%"><%=rs("bm")%> </td>
<td height="19" width="11%"><%=rs("qs_rq")%> </td>
</tr>
<%
rs.movenext
loop
rs.close
cn.close
set rs=nothing
set cn=nothing
%>
</table>
</td>
</tr>
<tr>
<td align="center">

</td>
</tr>
</body>
</html>
在我的机器上查询都正常,可是在其他的机器上,也包括服务器上我不能把前一页的时间参数带过来,但是我要是把以下这段代码去掉后,在其他的机器就能把时间参数带过来!!!(其他机器系统,有98,也有2000和XP,我都试了)
<% '告诉浏览器用word来显示文档内容
Response.ContentType = "application/msword"
'文档设定
response.AddHeader "content-disposition", "inline; filename=prin.doc"
%>
请各位高手帮我看看!谢谢!



...全文
39 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,391

社区成员

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

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