Sub CleanUpGIF(GIFpath)
Dim objFS
Dim objFolder
Dim gif
set objFS = Server.CreateObject("Scripting.FileSystemObject")
set objFolder = objFS.GetFolder(GIFpath)
for each gif in objFolder.Files
if instr(gif.Name, ".gif") > 0 and
DateDiff("n", gif.DateLastModified, now) > 10 then
objFS.DeleteFile GIFpath & "\" & gif.Name, True
end if
next
set objFolder = nothing
set objFS = nothing
End Sub
set objChartSpace = Server.CreateObject("OWC.Chart")
set objChart = objChartSpace.Charts.Add
set c = objChartSpace.Constants
objChartSpace.Border.Color="red"
'以柱状图显示
objchart.type=1
objChart.HasLegend = True'是不是显示图例
objChartSpace.HasChartSpaceTitle=true '显示题目
objChartSpace.ChartSpaceTitle.Caption ="柱状图的例子利用office web组件--www.ourfly.com中文手艺网站"
set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open application("strconn")
set objRS = Server.CreateObject("ADODB.Recordset")
set objRS.ActiveConnection = objConn
objRS.CursorType = adOpenStatic
objRS.CursorLocation = adUseClient
objRS.Open "select dwsj,sum(jfrs) as jfrs
from dcss_do_jfgcfxb where dwsj>='"&sj1&"' and dwsj<'"&sj2&"'
group by dwsj order by dwsj asc"
set objChartSpace.DataSource = objRS
'显示图例内容
objChart.SetData c.chDimSeriesNames, 0, "jfrs"
for each objSeries in objChart.SeriesCollection
objSeries.SetData c.chDimCategories, 0, "dwsj"
objSeries.SetData c.chDimValues, 0, "jfrs"
next
for each axis in objChart.Axes
axis.HasTitle = True
if axis.Type = c.chCategoryAxis then
axis.Title.Caption = "月份"
else
axis.Title.Caption = "人数"
end if
next