Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. retrieving data fro database

retrieving data fro database

Scheduled Pinned Locked Moved XML / XSL
databasehelphtmlsysadmintesting
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gazzer
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups