为什么出不了图(关于office 2000 web component)
我参照微软的例子写了一段程序,想出一个价格走势图,可就是出不了图,哪位大虾帮忙看一下是什么原因?(错误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>