How to resolve runtime error ('800a01a8' ) in VBScript (classic ASP)?

johnmullins

New Member
I have following classic asp code:\[code\]<%@ Language=VBScript %><HTML><HEAD> <TITLE>FusionCharts Free - Database Example</TITLE> <SCRIPT LANGUAGE="Javascript" SRC="http://stackoverflow.com/FusionCharts/FusionCharts.js"></SCRIPT> </HEAD> <!--#INCLUDE VIRTUAL="MyWeb/includes/FusionCharts.asp"--> 'Adding library script that will connect to the Access Databse file automatically. <!--#INCLUDE VIRTUAL="MyWeb/includes/DBConn.asp"--> <BODY> <CENTER> <% 'In this example, we show how to connect FusionCharts to a database. 'For the sake of ease, we've used an Access database which is present in '../DB/FactoryDB.mdb. It just contains two tables, which are linked to each 'other. 'Database Objects - Initialization Dim oRs, oRs2, strQuery, 'strXML will be used to store the entire XML document generated Dim strXML 'Create the recordset to retrieve data Set oRs = Server.CreateObject("ADODB.Recordset") 'Generate the chart element strXML = "<graph caption='Factory Output report' subCaption='By Quantity' decimalPrecision='0' showNames='1' numberSuffix=' Units' pieSliceDepth='30' formatNumberScale='0'>" 'Iterate through each factory strQuery = "select * from deal_price" Set oRs = oConnection.Execute(strQuery) While Not oRs.Eof 'Now create second recordset to get details for this factory Set oRs2 = Server.CreateObject("ADODB.Recordset") strQuery = "select sum(Quantity) as TotOutput from Factory_Output where FactoryId=" & ors("FactoryId") Set oRs2 = oConnection.Execute(strQuery) 'Generate <set name='..' value='http://stackoverflow.com/questions/12711467/..'/> strXML = strXML & "<set name='" & ors("FactoryName") & "' value='" & ors2("TotOutput") & "' />" 'Close recordset Set oRs2 = Nothing oRs.MoveNextWend 'Finally, close <chart> element strXML = strXML & "</chart>" Set oRs = nothing'Create the chart - Pie 3D Chart with data from strXML Call renderChart("../../FusionCharts/FCF_Pie3D.swf", "", strXML, "FactorySum", 650, 450) %> </BODY> </HTML>\[/code\]DBconnection file code:\[code\]Dim oConnectionSet oConnection = Server.CreateObject("ADODB.Connection")oConnection.Open "Provider=SQLOLEDB; Data Source=MA-PC\SQLEXPRESS; Initial Catalog=test; User ID=missy; Password=hello;" oConnection.Close Set oConnection = Nothing\[/code\]I am getting a run time error on the line which says the following:Set oRs = oConnection.Execute(strQuery). I can not seem to work out, where I am going wrong. Any Assistant would be very much appreciated. Thanks you in advance.
 
Back
Top