View Single Post
 
Old April 28th, 2004, 12:33 PM
Pattri Pattri is offline
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Proffesional ASP XML Book- Help with error

Hi everyone!

On chapter 6 there's an error running displaycontacts.asp:
Microsoft VBScript (0x800A01A8)Error, An object is required. Line 22.

Anyone have the same problem? Here is the code:

<%
  Dim sourceFile, source, rootElement, HTMLCode

  ' Set the source of XML here
  'sourceFile =

  ' Create an instance of the XML parser and load the XML into the DOM
  Set source = Server.CreateObject("Microsoft.XMLDOM")
source.async = false
  source.load (Server.MapPath("\ch6\contacts.xml"))
  Set rootElement = source.documentElement

  ' Build the string that will be sent to the browser
  HTMLCode = HTMLCode & ""
  HTMLCode = HTMLCode & rootElement.childNodes(0).text
  HTMLCode = HTMLCode & "<P></P><I>"
  HTMLCode = HTMLCode & rootElement.childNodes(1).text
  HTMLCode = HTMLCode & "</I><P></P>"
  HTMLCode = HTMLCode & rootElement.childNodes(2).text
  HTMLCode = HTMLCode & "<P></P>"

  Response.Write HTMLCode

  Set source = nothing

%>
Thanks,

Pattri