浏览器解析之怪现象

ruonaner 2004-12-29 11:54:05
在报表显示时遇到一个怪现象:

服务器A:P4,512RAM; Windows Server 2003, SQLServer 2000
服务器B:P4,256RAM; Windows 2000 服务器版,SQLServer 2000

在服务器A,B上发布了同一系统(数据库相同,ASP版程序相同),在显示一报表(数据量较大,可以查询任意两天、任意旬的信息)时出现下面的怪现象:

服务器A:查询某两天的信息时正常,查询旬的信息时,显示不出表格的横竖线,只有部分查询的信息杂乱地显示出来;

服务器B:查询某两天、旬的信息时都正常。

请问这是什么原因?
...全文
172 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
ruonaner 2005-01-15
  • 打赏
  • 举报
回复
楼上说得很对了,今天又碰到同样的问题了,Windows Server 2003确实在访问SQL Server 2000数据库时存在问题,装了SQL Server 2000 SP3 就解决了。
chinesetree 2005-01-15
  • 打赏
  • 举报
回复
Windows Server 2003
给sql 2000打个补丁sql 2000 sp3
ruonaner 2004-12-31
  • 打赏
  • 举报
回复
问了很多朋友同事,他们都说没有遇到这种现象。
???
ruonaner 2004-12-30
  • 打赏
  • 举报
回复
不要意思,在发出回复的时候已经排好版了,哪知一生成静态页面就这样。
<%
'程序注释
'*****************************************************************************
'程序名称:dotDbOutput.asp
'程序类型:ASp
'程序功能:按照站、月份、旬查询出站的某旬的项目指标数据报表
' 说明:项目-->表格的横标题,
' 指标-->表格的竖标题
' 数据-->横竖坐标的交叉点
' 由于不同的横坐标的竖坐标有相同的,有不一致的
' 于是取所有横坐标的竖坐标的集合做总竖坐标,
' 某一天的项目指标数据就构成一个完整的报表,但是为了方便
' 要查询出一个旬的数据
'设计时间:2004-8-10
'代码设计者: wjj/ruonaner@etang.com
'*****************************************************************************
'实现方法:1、先由参数 selStationId(所选择的站) 得到该站的所有项目的指标
' 名称,存放一数组中;
' 2、由参数 selStationId(所选择的站) 得到该站的项目信息;
' 3、对日期循环;
' 4、在某一日期内,对项目循环,查询某天某个项目的指标数据
' 在此调用了公共文件 dotDbOutputCommon.asp。

'=============================================================================
'备注:
'******************************************************************************
%>
<% '引入界面缓冲文件%>
<!-- #include file="../common/load.inc" -->
<% '引入数据库连接文件%>
<!-- #include file="../common/conn.asp" -->
<%
'/************************************得到参数********************************
dim dtmDate '日期
dim intXun '旬
dim intStationId '站标识
dtmDate = request("txtDate") '获得参数:日期
intXun = request("selXun") '获得参数:旬
intStationId = empty2Zero( request("selStationId") ) '得到要查询某个站
'*************************************得到参数结束************************/

'/************************************根据参数初始化***********************
if cint(intStationId)=0 then
debug("请选择站!")
end if

'intDateNum 得到查询日期的天数
if dtmDate = "" then
'没有查询日期,默认为当前日期
dim intDateNum '查询日期的天数
dtmDate = date()
intDateNum = getDayNum(dtmDate)
else
'参数txt得到要查询的日期Date得到的日期格式是 YYYY-MM
dim dtmYearMonth 'MMMM-MM
intDateNum = getDayNum(request("txtDate")&"-1")
dtmYearMonth = request("txtDate")
dtmDate = dtmYearMonth&"-1"
end if

'默认查询除上旬的报表信息
if intXun="" then
intXun = 1
end if
'**************************************初始化结束************************/

'/*************************************报表处理***************************
'得到站的名称
dim strSql '查询串
dim rsStation '站记录集
strSql = "SELECT v_name FROM asy_station_info WHERE i_station_id="&intStationId
set rsStation = conn.Execute(strSql)
'错误处理
checkDbError(strSql)

'组合得到表头信息
dim strTitle '表头字符串
strTitle = rsStation("v_name")&"   "&year(dtmDate)&_
" 年 "&month(dtmDate)&" 月 "&strXunName&" 基本点库"

'获得所有的 指标 名称
dim rsTarget '指标记录集
strSql = "select distinct v_target_name from "&_
"asy_output_target_info WHERE ti_state=1 order by v_target_name"
set rsTarget = conn.Execute(strSql)
'错误处理
checkDbError(strSql)
if rsTarget.eof then
'当前没有项目信息
debug( "当前没有指标信息,没有数据" )
end if
'定义数组来保存指标信息
dim arrTarget(100) '最多一百个不同的指标
dim intTargetNum '输出指标计数器
intTargetNum = 0 '保存输出指标
while not rsTarget.eof
arrTarget(intTargetNum) = rsTarget("v_target_name")
intTargetNum = intTargetNum+1
rsTarget.MoveNext
wend
'由指标数据来获得表格宽度
intTableWidth = (intTargetNum+5)*60


'显示标题
response.write "<div align='center' >"&strTitle&"</div>"&chr(13)
response.Write "<table border='1' width='"&intTableWidth&"'>"&chr(13)
response.Write "<tr>"&chr(13)
response.Write "<td align='center' class='printTd' "&_
"width='60'>Id号</td>"&chr(13)
response.Write "<td align='center' class='printTd' "&_
"width='80'>项目名称</td>"&chr(13)
response.Write "<td align='center' class='printTd' "&_
"width='60'>日期</td>"&chr(13)
response.Write "<td align='center' class='printTd'"&_
" width='60'>时间</td>"&chr(13)
response.Write "<td align='center' class='printTd' "&_
"width='60'>班次</td>"&chr(13)

'显示指标名称
rsTarget.MoveFirst
while not rsTarget.eof
response.Write "<td align='center' class='printTd'"&_
" width='60'>"&rsTarget("v_target_name")&_
"</td>"&chr(13)
rsTarget.MoveNext
wend
response.Write "</tr>"&chr(13)

'获得该站下的 项目 的相关信息,主要为了得到项目Id(i_item_id),
'项目名称(v_item_name),
'由i_item_id、日期得到该日期的项目的指标信息
dim rsItem '项目记录集
strSql = "select i_item_id,v_item_name,(ti_code_state+i_output_target_num)+1 "&_
" as targetNum,ti_code_state from v_getItemInfo "&_
" where i_item_id in ( select i_item_id from v_asy_items where "&_
" ti_state=1 and i_station_id="&intStationId&_
" ) order by i_order,i_item_id "
set rsItem = conn.Execute(strSql)
'错误处理
checkDbError(strSql)
if rsItem.eof then
'当前没有项目信息
debug( "当前没有项目信息,没有数据" )
end if

'定义数组来保存项目各种信息,这里假设一个站最多200个项目
dim arrWidth(200) '保存项目的宽度
dim arrCode(200) '保存项目的代号
dim arrData(200) '保存项目的数据集
dim arrHead(200) '保存项目的头信息数据集
dim intI '循环计数器
dim intStart '开始日期的天数
dim strXunName '表列标题
'由参数intXun得到要查询数据的开始日期的天数、截至日期的天数,
'以及要显示的列标题
if Cint(intXun)=1 then
strXunName = "上旬"
intStart = 1
if Cint(intDateNum)>=10 then
intDateNum = 10
end if
elseif Cint(intXun)=2 then
strXunName = "中旬"
intStart = 11
if Cint(intDateNum)>=20 then
intDateNum = 20
end if
else
strXunName = "下旬"
intStart = 21
end if

'循环显示从开始日期到截至日期的项目指标信息,先显示开始
'日期的所有项目指标信息,
'然后日期递增显示
for intI=Cint(intStart) to Cint(intDateNum)

'/************************************************************************
'在此特意做了测试,查询两天的项目指标数据在服务器A、服务器B上可以正常显示
'for intI=Cint(intStart) to Cint(intStart)+1
'************************************************************************/

dtmDate = dtmYearMonth&"-"&intI
%>
<!--#include file = "dotDbOutputCommon.asp"-->
<%
next
response.Write "</table>"&chr(13)
'/************************报表处理结束****************************
%>
ruonaner 2004-12-30
  • 打赏
  • 举报
回复
这是相关部分的主要代码:
<%
'程序注释
'*****************************************************************************
'程序名称:dotDbOutputCommon.asp
'程序类型:ASp
'程序功能:查询项目某天的指标数据公共文件
'设计时间:2004-8-10
'代码设计者: wjj/ruonaner@etang.com
'*****************************************************************************
'实现方法:1、对项目进行循环;
' 2、调用存储过程获得当前项目当前天的指标信息
' 3、对指标进行循环
' 4、当前指标,对指标数组进行循环,如果当前指标与
' 指标数组的指标相同,显示指标数据;否则,显示空
'=============================================================================
'备注:
%>
<%
intItemNum = 0 '记录项目数量
'对项目进行循环,查询出该项目当前天的指标数据
while not rsItem.eof
arrWidth(intItemNum) = empty2Zero(rsItem("targetNum")) '保存项目的宽度
arrCode(intItemNum) = empty2Zero(rsItem("ti_code_state"))'保存项目的编号状态
'获得各个项目的头信息
tmpStrSql = "SELECT v_target_name,v_field_name FROM asy_output_target_info "&_
" WHERE i_item_id='"&rsItem("i_item_id")&"' and ti_state=1"&_
" order by v_target_name asc"
err.Clear
set arrHead(intItemNum) = conn.Execute(tmpStrSql)
'错误处理
checkDbError(tmpStrSql)
'获得各个项目的数据信息
'调用存储过程或的该项目的值 exec sp_asy_getDotDbData @itemId,@dtmDate
strTmpSql = "exec sp_asy_getDotDbData '"&rsItem("i_item_id")&"','"&dtmDate&"'"
err.Clear
set arrData(intItemNum) = conn.Execute(strTmpSql)
checkDbError(strTmpSql)
'循环显示该项目的数据
while not arrData(intItemNum).eof
strDate = year(arrData(intItemNum)("assayTime"))&"-" &_
month(arrData(intItemNum)("assayTime"))&"-"&_
day(arrData(intItemNum)("assayTime"))
strTime = Hour(arrData(intItemNum)("assayTime"))&";" &_
minute(arrData(intItemNum)("assayTime"))
response.Write "<tr>"&chr(13)
response.Write "<td align='center' class='printTd'>"&_
rsItem("i_item_id")&"</td>"&chr(13) '项目id号
response.Write "<td align='center' class='printTd'>"&_
rsItem("v_item_name")&"</td>"&chr(13) '项目名称
response.Write "<td align='center' class='printTd'>"&_
strDate&"</td>"&chr(13) '日期
response.Write "<td align='center' class='printTd'>"&_
strTime&"</td>"&chr(13) '时间
response.Write "<td align='center' class='printTd'>"&_
arrData(intItemNum)("teamNum")&"</td>"&chr(13)'班次
arrHead(intItemNum).MoveFirst

'对指标名称数组循环,当某一项目的指标名称和当前指标名称相同,
'则表示该项目有该指标;否则显示空格
for i=0 to cint(intTargetNum-1)
if not arrHead(intItemNum).eof then
if strComp(arrHead(intItemNum)("v_target_name"), arrTarget(i),1)=0 then
strTmp = arrHead(intItemNum)("v_field_name")
'当前指标是要显示的指标,显示数据
intShowNum = arrData(intItemNum)(strTmp)
response.Write "<td align='center' "&_
"class='printTd'>"&_
myFormatNumber(intShowNum,3)&_
"</td>"&chr(13)
if not arrHead(intItemNum).eof then
arrHead(intItemNum).MoveNext
end if
else
response.Write "<td align='center' "&_
"class='printTd'> "&_
"</td>"&chr(13)
end if
else
response.Write "<td align='center' "&_
"class='printTd'> "&_
"</td>"&chr(13)
end if
next
response.Write "</tr>"&chr(13)
arrHead(intItemNum).MoveFirst
arrData(intItemNum).MoveNext
wend
rsItem.MoveNext
intItemNum = intItemNum +1
wend
%>
孟子E章 2004-12-30
  • 打赏
  • 举报
回复
把你的table的border设置为1,就可以看出你 的表格是否对 了。
孟子E章 2004-12-30
  • 打赏
  • 举报
回复
看你客户端生成的html标记是否对,估计是td,tr等不封闭造成 的
ruonaner 2004-12-30
  • 打赏
  • 举报
回复
我也怀疑过可能是代码的问题,可是为什么服务器B一切正常,并且服务器A查询两天的报表信息正常而查询旬的报表信息就不正常?
ruonaner 2004-12-29
  • 打赏
  • 举报
回复
谢谢各位的光临指教。

to deerchao:
页面源文件和和页面显示的信息是对应的,页面上有什么,源文件能找到与之对应的东东。

to iuhxq:
服务器A和服务器B客户端得到的页面源文件不一样,服务器A得到的客户端源文件很怪,连一个<tr>都没有(之所以没有显示表格的横竖线?);服务器端B得到的页面源文件正常。

这是怎么回事呢?
flyingsnowy 2004-12-29
  • 打赏
  • 举报
回复
up
patchclass 2004-12-29
  • 打赏
  • 举报
回复
只有部分查询的信息杂乱地显示出来
可能表格错位吧,看看输出的源html代码
iuhxq 2004-12-29
  • 打赏
  • 举报
回复
看客户端得到的代码一样吗?
deerchao 2004-12-29
  • 打赏
  • 举报
回复
请查看页面源文件。看看源文件正确不正确。

如果页面内容过多,网速过快,IE确实有显示空白的bug.
但是只要全选,内容就出来了。
alianasia 2004-12-29
  • 打赏
  • 举报
回复
光从楼主的说法里看不出什么问题来..

不过2003本身现在还有不少问题...
yqh1314 2004-12-29
  • 打赏
  • 举报
回复
不好意思我看来是帮不上你了` 我从没有用过2003 哎!·
wcbm 2004-12-29
  • 打赏
  • 举报
回复
你最好是把你的那些相关的代码贴出来,我想应该是代码的问题
purexu 2004-12-29
  • 打赏
  • 举报
回复
可能是代码的问题
ruonaner 2004-12-29
  • 打赏
  • 举报
回复
难道只有我遇到这样古怪的现象吗?
ruonaner 2004-12-29
  • 打赏
  • 举报
回复
server2003是中文版的,这个server2003还是给人家客户买的正版的,不能随便换系统吧。
deerchao 2004-12-29
  • 打赏
  • 举报
回复
那就是兼容性的问题了。
server2003是中文版的吗?

要不就不要用2003了。

28,390

社区成员

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

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