Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Posts
    1

    Unhappy Unanswered: Error 0X800A01A8

    I get a object required error on this asp script can any on e tell me what is wrong?
    Microsoft VBScript runtime (0x800A01A8)
    Object required
    /weather/form.asp, line 11

    Script:

    <!--#include file=inc_top.asp -->
    <!--#include file=inc_global.asp -->
    <%
    dim xmlDoc, xmlElem, strForm
    strForm = ""
    set xmlDoc = Server.CreateObject("Msxml2.DOMDocument")
    xmlDoc.async = False
    xmlDoc.load Server.MapPath(cfgWXDataPath & "wxsettings.xml")
    if xmlDoc.parseError.errorCode = 0 then
    set xmlElem = xmlDoc.selectSingleNode("/settings/form")
    strForm = xmlElem.text

    if Request.Form("submit").Count > 0 then
    xmlDoc.childNodes(1).removeChild(xmlElem)
    strForm = CStr(Request.Form("form"))
    end if
    set xmlElem = nothing
    else
    xmlDoc.loadXML "<?xml version=""1.0"" ?><settings></settings>"
    end if

    if Len(strForm) = 0 or Request.Form("submit").Count > 0 then
    set xmlElem = xmlDoc.createElement("form")
    if Request.Form("submit").Count = 0 then
    strForm = "<form method=post action=subscribe.asp>" & vbCrLf &_
    "<table align=center border=0>" & vbCrLf &_
    "<tr><td>Your name</td><td><input type=text name=name></td></tr>" & vbCrLf &_
    "<tr><td>E-mail</td><td><input type=text name=email></td></tr>" & vbCrLf &_
    "<tr><td colspan=2 align=center><input type=radio name=subscribe checked value=1>Subscribe</td></tr>" & vbCrLf &_
    "<tr><td colspan=2 align=center><input type=radio name=subscribe value=0>Unsubscribe</td></tr>" & vbCrLf &_
    "<tr><td colspan=2 align=center><input type=submit name=submit value=Submit></td></tr>" & vbCrLf &_
    "</table></form>"
    end if
    xmlElem.appendChild xmlDoc.createCDATASection(strForm)
    xmlDoc.childNodes(1).appendChild xmlElem
    xmlDoc.save Server.MapPath(cfgWXDataPath & "wxsettings.xml")
    set xmlElem = nothing
    set xmlDoc = nothing
    end if
    %>
    <h2 align="center">Subscribe form settings</h2>
    <p>

    </p>
    <form action="form.asp" method="post">
    <table align="center" border="0">
    <tr>
    <td align="center"><textarea rows="15" name="form" style="width:75%" cols="20"><%=strForm%></textarea></td>
    </tr>
    <tr>
    <td align="center"><input type="submit" name="submit" value="Save" class="button"></td>
    </tr>
    </table>
    </form>
    <p align="center"><b>Preview</b></p>
    <hr align="center" width="75%">
    <table align="center" border="0">
    <tr>
    <td><%=strForm%></td>
    </tr>
    </table>
    <hr align="center" width="75%">
    <!--#include file=inc_bottom.asp -->

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    well it looks like your problem is in here somewhere....
    Code:
    xmlDoc.load Server.MapPath(cfgWXDataPath & "wxsettings.xml")
    if xmlDoc.parseError.errorCode = 0 then
    set xmlElem = xmlDoc.selectSingleNode("/settings/form")
    strForm = xmlElem.text
    it's a little hard to say where though...

    It could be that your xml is not loading properly. Your parse error check should catch that from memory but I'm not sure. you might want to do something like response.write xmlDoc.innerXML or something to check it.

    It could be that it is not finding the node you are trying to select. Once again a debug statement similar to the one above should help you determine the actual events happening here.

    Finally it could be that xmlElem.text does not return a string but returns an object and therefore needs a set statement but I don't think that is the case.

    Additional to this it could also be something in the include files and not in this actual file....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •