为什么出不了图(关于office 2000 web component)

bibibi 2000-07-11 11:32:00
我参照微软的例子写了一段程序,想出一个价格走势图,可就是出不了图,哪位大虾帮忙看一下是什么原因?(错误1:找不到request对象,错误2:找不到数据库)
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Binding the Chart to a Recordset</title>
<link rel="STYLESHEET" href="../Styles/OWCStyle.css" type="text/css">
</head>
<body background="green.gif" topmargin="0" leftmargin="0">
<object classid="clsid:0002E500-0000-0000-C000-000000000046" id="ChartSpace1"
style="HEIGHT:80%; WIDTH:100%" width="576" height="384">
</object>

<script language=VBScript>
Sub Window_onLoad()
dim MarketId,Type1,Etalon,rs,con
session("MarketId")=request.querystring("MarketId")
session("Type")=request.querystring("Type")
session("Etalon")=request.querystring("Etalon")

MarketId=session("MarketId")
Type1=session("Type")
Etalon=session("Etalon")

if Etalon="综合" then
sql="select ProductName,ReferencePrice,HighestPrice,lowestPrice,TradeQuantity,Memo,CollectTime from ProductPrice where ProductName='"&Type1&"' and PriceSource='"&MarketId&"' order by CollectTime desc"
else
sql="select ProductName,ReferencePrice,HighestPrice,lowestPrice,TradeQuantity,Memo,CollectTime from ProductPrice where ProductName='"&Type1&"' and PriceSource='"&MarketId&"' and ProductEtalon='"&Etalon&"' order by CollectTime desc"
end if

con="server=aaa;provider=sqloledb;data source=znt;uid=sa;pwd=;"
set rs=CreateObject("ADODB.Recordset")
rs.CursorLocation = 3
rs.open sql,con,3

BindChartToRecordset ChartSpace1,rs,"ProductName","CollectTime","ReferencePrice"

end sub


sub BindChartToRecordeset (cspace,rs,sfldSeries,sfldXValues,sfldYValues)
dim cht,ser,ax
set c=cspace.Constants
cspace.clear
set cspace.DataSource=rs
set cht=cspace.Charts.Add()
cht.HasLegend=true
cht.Type=c.chChartTypeScatterMarkers
cht.SetData c.chDimSeriesNames, 0, sfldSeries
cht.SetData c.chDimXValues, 0, sfldXValues
cht.SetData c.chDimYValues, 0, sfldYValues


set ax=cht.Axes(c.chAxisPositionBottom)
ax.HasTitle=True
ax.Title.Caption=sfldXValues
ax.Title.Font.Name="图表"
ax.Title.Font.Size=8
ax.Title.Font.Bold=True
ax.NumberFormat="#,##0"

set ax=cht.Axes(c.chAxisPositionLeft)
ax.HasTitle=True
ax.Title.Caption=sfldYValues
ax.Title.Font.Name="图表"
ax.Title.Font.Size=8
ax.Title.Font.Bold=True
ax.NumberFormat="$#,##0"

end sub
</script>
</body>
</html>

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

28,390

社区成员

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

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