retrieving data fro database
-
Could someone please look at the following code and tell me why I get the error below. Sorry for the length of code. =====ERROR on Page ====== Microsoft VBScript runtime error '800a000d' Type mismatch: 'child.Text' /council_services/data/wastedata.asp, line 60 The error occurs no matter which field I choose from the database recordset. Now the same code works fine with another database I used for testing, but not this one. Please help. =====END ERROR ===== Within the following code. =====CODE===== <% '------------------------ DATABASE CONNECTION ----------------------------------------- 'The database connection is done through the include file above. '------------------------ XML DOM OBJECT CREATION ------------------------------------ 'Create XMLDOM Object Dim xmldoc Set xmldoc = Server.CreateObject("Microsoft.XMLDOM") '------------------------ BULK OF XML CODE ------------------------------------------------ If (xmldoc.childNodes.length = 0) Then ' Build the XML document, and asign the root node. Set root = xmldoc.createNode("element", "council_services", "") xmldoc.appendChild (root) ' Queries the database for customer data, this will be referenced later. ' Use recordset(0) where 0 is the order of the datafield of the recordset. Sql = "SELECT StreetName, Area, Round, Day FROM WasteCollection" Set rs = conn.Execute(Sql) If Rs.eof or rs.bof then 'If there are no results from the search criteria, then put the following text 'onto the page Response.Write "
" & "There are currently no information available, please try again." & "
" Else rs.MoveFirst 'Loop through the recordset Do While Not rs.EOF Set onode = xmldoc.createNode("element", "Waste", "") xmldoc.documentElement.appendChild (onode) 'The following code, sets the child elements of the recordset 'to the xml data page. 'Set child = xmldoc.createNode("element", "CollectionStreet", "") 'child.Text = rs.fields(0) 'onode.appendChild (child) 'Set child = xmldoc.createNode("element", "CollectionArea", "") 'child.Text = rs.fields(1) 'onode.appendChild (child) 'Set child = xmldoc.createNode("element", "CollectionRound", "") 'child.Text = rs.fields(2