having problem with EOF error.
1 table
with 8 fields
I just want a plain chart with date as the series and the rest are columns (bakery, meat etc.)
I tried to follow some of the samples provided but it doesn't have a simple query sample.
thanks in advance!
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Connections/DepartmentSales.asp" -->
<%
Dim rsDepSales
Dim rsDepSales_cmd
Dim rsDepSales_numRows
Dim StrQuery
Dim Intcounter
intcounter = 0
Set rsDepSales_cmd = Server.CreateObject ("ADODB.Command")
rsDepSales_cmd.ActiveConnection = MM_DepartmentSales_STRING
'Generate the chart element string
strXML = "<chart palette='2' caption='Factory' zAxisname='Date' showvalues='1' labelstpe='2'>"
'Now we get the data for the factory
rsDepSales_cmd.CommandText = "SELECT * FROM dbo.Department WHERE [Date] = '12/29/2010'"
rsDepSales_cmd.Prepared = true
Set rsDepSales = rsDepSales_cmd.Execute
rsDepSales_numRows = 0
Whole Not rsDepSales.Eof
'Here, we convert date into a more readable format for set label.
strXML = strXML &
"<set label ='Bakery'" & "Value='<%=(rsDepSales.Fields.Item("Date").Value)%>'/>" &
"<set label ='Dairy'" & "Value='<%=(rsDepSales.Fields.Item("Date").Value)%>'/>"
set rsDepsales = Nothing
rsdepsales.movenext
Wend
'Close <chart> element
strXML = strXML & "</chart>"
set rsdepsales = nothing
Response.Write(strXML)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Chart Test 01</title>
</head>
<body>
<%=(rsDepSales.Fields.Item("Date").Value)%>
</body>
</html>
<%
rsDepSales.Close()
Set rsDepSales = Nothing
%>