SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Evangelist OwainGDWilliams's Avatar
    Join Date
    Aug 2005
    Location
    Scotland, UK
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error 424 Object required.

    Hi!
    I have been looking after a site for a while now and never had any problems with the scripts.
    All of a sudden, we upgrade the server to 2003 from 2000 and I am now getting an error 424 on one of the scripts.

    The strange thing is it was working for the first 2 days the new server was running. I havent changed anything in the script but now its dead.

    Ive searched the net to find out what the 424 object required error actually means but found nothing, can some one please help.

    The code is below :

    Code:
    <%@ LANGUAGE="VBSCRIPT" %>
    <%
    On Error resume next
    Dim objFSO, objFolder, dFileDate, objDocument, objRootNode, objChannelNode, sW3Root,  iFolderID, objNodeList, strReturnMessage
    
    iFolderID = 0
    
    sW3Root = Application("sW3root")
    
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    
    Set objFolder = objFSO.GetFolder(Server.MapPath("/my/folder/path"))
    
    
    Set objDocument = CreateObject("MSXML2.FreeThreadedDOMDocument.4.0")
    objDocument.async = False
    objDocument.validateOnParse = False
    objDocument.resolveExternals = False
    objDocument.load (Server.MapPath("/my/folder/rolls.xml"))
    
    Set objRootNode = objDocument.documentElement
    Set objChannelNode = objRootNode.firstChild
    
    Set objNodeList = objDocument.getElementsByTagName("item")
    For Each elem in objNodeList
       objChannelNode.removeChild (elem)
    Next
    
    
    Sub doItems()
    
    Dim  objFolderNode, objItemNode, objItemText, objTitleNode, objTitleText, objLinkNode, objLinkText, objDateNode, objDateText, objDescriptionNode, objDescriptionText, collfiles, objFile, strURL, strTitle, strDescription, strName, strDate, strDay, strMo, strYr, dDate
    
    Dim objRegEx
    Set objRegEx = New RegExp
    objregEx.IgnoreCase = True
    objRegEx.Pattern = "^R[0-9]{2}[0-1]{1}[0-9]{1}[0-3]{1}[0-9]{1}_[0-9]+\.htm$"
                            Set collfiles = objFolder.files
                                    For each objFile in collfiles
    
                                            strName = objFile.Name
    
                                            if objRegEx.Test(strName) Then
    
                                                    strURL  = LCase(objFile.path)
                                                    strURL = replace(strURL, sW3Root, "")
                                                    strURL = replace(strURL, "\", "/")
                                                    strURL = "myDomain.com" & strURL
    
                                                    strDate = Mid(strName, 2, 6)
                                                    strYr = "20" & Left(strDate, 2)
                                                    strMo = Mid(strDate, 3, 2)
                                                    strDay = Right(strDate, 2)
                                                    strDate = strYr & "-" & strMo &  "-" & strDay
    
                                                    strTitle = "Issue " &  Mid(strName, 9, (Len(strName)-12))
                                                    strDescription = "my Description" & " " &  Mid(strName, 9, (Len(strName)-12))
    
                                                    Set objItemNode = objDocument.createElement("item")
    
    
                                                    Set objTitleNode = objDocument.createElement("title")
                                                    Set objTitleText = objDocument.createTextNode(strTitle)
                                                    objTitleNode.appendChild(objTitleText)
    
    
                                                    Set objLinkNode = objDocument.createElement("link")
                                                    Set objLinkText = objDocument.createTextNode(strURL)
                                                    objLinkNode.appendChild(objLinkText)
    
                                                    Set objDescriptionNode = objDocument.createElement("description")
                                                    Set objDescriptionText = objDocument.createTextNode(strDescription)
                                                    objDescriptionNode.appendChild(objDescriptionText)
    
                                                    Set objDateNode = objDocument.createElement("dc:date")
                                                    Set objDateText = objDocument.createTextNode(strDate)
                                                    objDateNode.appendChild(objDateText)
    
                                                    objItemNode.appendChild objTitleNode
                                                    objItemNode.appendChild objLinkNode
                                                    objItemNode.appendChild objDescriptionNode
                                                    objItemNode.appendChild objDateNode
    
                                                    objChannelNode.appendChild objItemNode
    
                                            End If
    
                                    Next
    
    End Sub
    
    Call doItems()
    
    objDocument.save(sW3Root & "\my\folder\rolls.xml")
    
    Set objRootNode = Nothing
    Set objFileNode = Nothing
    Set objTitleNode = Nothing
    Set objDateNode = Nothing
    Set objLinkNode = Nothing
    Set objDateNode = Nothing
    Set objDescriptionNode = Nothing
    Set objFolder = Nothing
    Set objDocument = Nothing
    
    If Err.number = 0 then
    	strReturnMessage="<p style=""font-weight:bold; font-size:20px;"">Rolls were updated successfully.</p>"
    else
    	strReturnMessage="<p style=""font-weight:bold; font-size:20px;"">An error occurred whilst updating the Rolls.</p><p>Error decription: " & Err.description & "<br />Error code: " & Err.number &"<br/>Please email <a href=""mailto:myemailaddress"">myemailaddress</a>, pasting the above error description and code into your message.</p>"
    End if	
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>WEbsite Title</title>
    </head>
    <body>
    <%=strReturnMessage%>
    </body>
    </html>
    Failure happens, its what you learn from it that is important!

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Which line in the code is throwing the error?

    Is this relevant?
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Evangelist OwainGDWilliams's Avatar
    Join Date
    Aug 2005
    Location
    Scotland, UK
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unfortunelty I do not get a line number in the error message!

    I tried the page you sent me but that also does not fix the problem. Any other ideas?

    Thanks,
    O.
    Failure happens, its what you learn from it that is important!

  4. #4
    SitePoint Evangelist OwainGDWilliams's Avatar
    Join Date
    Aug 2005
    Location
    Scotland, UK
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't want to speak too soon, but it looks like I have fixed it!

    It seemed to be a permissions problem on the folder the script was located in. Fingers crossed that is it working, no idea why the permissions had changed since I am the only one with access to the server but never mind.

    O.
    Failure happens, its what you learn from it that is important!

  5. #5
    SitePoint Evangelist OwainGDWilliams's Avatar
    Join Date
    Aug 2005
    Location
    Scotland, UK
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    &&#37;!?&&#163;%!!!!!!!

    Nope it didnt work, well it fixed on part of the site but in the process blogged joe blogs from viewing the other sections of the site. Ive had to remove the permissions I had so that people can view the rest of the site and the Error 424 has come back.

    So, again, open to ideas what might be causing this.

    O.
    Failure happens, its what you learn from it that is important!

  6. #6
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Set objDocument = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.4.0")

    /long-shot
    Ian Anderson
    www.siteguru.co.uk

  7. #7
    SitePoint Wizard bbolte's Avatar
    Join Date
    Nov 2001
    Location
    The Central Plains
    Posts
    3,304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    look through the logs for the line the error is happening in, but i'm with sitegure, i'd bet that the MS XML object isn't installed or a different/newer version possibly.

  8. #8
    SitePoint Evangelist OwainGDWilliams's Avatar
    Join Date
    Aug 2005
    Location
    Scotland, UK
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by siteguru View Post
    Set objDocument = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.4.0")

    /long-shot
    Just tried that and still getting the error message.

    Ive just reinstalled MS XML and still no luck I will try and find the logs and find out what line number its causing the problem on.

    O.
    Failure happens, its what you learn from it that is important!

  9. #9
    SitePoint Evangelist OwainGDWilliams's Avatar
    Join Date
    Aug 2005
    Location
    Scotland, UK
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I have some some testing and I have found that the error code changes from "0" to "424" on this line:

    Code:
    Set objChannelNode = objRootNode.firstChild
    Does that help anyone in working out why this is failing?

    O.
    Failure happens, its what you learn from it that is important!

  10. #10
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Code:
    ' On Error resume next
    What happens if you comment out that line? (Shown here commented out using ' character).
    Ian Anderson
    www.siteguru.co.uk

  11. #11
    SitePoint Evangelist OwainGDWilliams's Avatar
    Join Date
    Aug 2005
    Location
    Scotland, UK
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I get this error :

    Microsoft VBScript runtime error '800a01a8'

    Object required

    /rolls/supreme/writeRollsXML.asp, line 30

    and on line 30 is :

    Set.objChannelNode = objRootNode.firstChild

    Thanks for your help with this!

    O.
    Failure happens, its what you learn from it that is important!

  12. #12
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Look at the docs for MSXML2.FreeThreadedDOMDocument.4.0 and check that your XML file structure complies with the requirements.
    Ian Anderson
    www.siteguru.co.uk

  13. #13
    SitePoint Evangelist OwainGDWilliams's Avatar
    Join Date
    Aug 2005
    Location
    Scotland, UK
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The thing is though, this script has ran for over a year with no problems on the Windows 2000 server, now its on the Server 2003 it brings up this error.

    I will be running it again within the hour so I will see if its not running because of another application which runs about 3:30.

    Cheers,
    O.
    Failure happens, its what you learn from it that is important!

  14. #14
    SitePoint Evangelist OwainGDWilliams's Avatar
    Join Date
    Aug 2005
    Location
    Scotland, UK
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well thanks for your help, it seems to have fixed itself. I'm guessing it was actually a problem with another application which sends details to this one and the error is the script basically saying there is nothing to be done.

    Cheer again,
    O.
    Failure happens, its what you learn from it that is important!


Bookmarks

Posting Permissions

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