Server.CreateObject Failed

Discussion in 'C#' started by gilgalbiblewheel, Aug 8, 2007.

  1. #1
    I tested the following:
    <%
    dim fs,fo,x
    set fs=Server.CreateObject("Scripting.FileSystemObject")
    set fo=fs.GetFolder("c:\test\") 'replaced with: [B]http://k.domaindlx.com/infowars/BeWiseAsSerpents/[/B]
    
    for each x in fo.files
      'Print the name of all files in the test folder
      Response.write(x.Name & "<br />")
    next
    
    set fo=nothing
    set fs=nothing
    %>
    Code (markup):
    But I got an error:
     
    gilgalbiblewheel, Aug 8, 2007 IP
  2. yugolancer

    yugolancer Well-Known Member

    Messages:
    320
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #2
    And what is on the 11th line?
    Post the code from the line 11 :)
     
    yugolancer, Aug 13, 2007 IP
  3. dizzy

    dizzy Peon

    Messages:
    43
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Looks like it's failing cause it can't find the 'Scripting' object.
    Make sure the site is it's on is set up with ASP.
     
    dizzy, Aug 13, 2007 IP
  4. yugolancer

    yugolancer Well-Known Member

    Messages:
    320
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #4
    If i understand well from what you've said the error is "Server.CreateObject Failed" but anyway it has given the expected results (has returned the list of the files).
    Usually this error is happening when the cdonts.dll file either isn't on the server at all or isn't registered ...
    However, you should contact your ISP and ask them about that.
    Btw, is that Windows Server 2003? If it's the WinServer 2k3 be aware that it actually does not install Collaboration Data Objects (CDO) and CDONTS for NTFS respectivelly.
    Therefore, application that uses CDONTS doesn't function on a Windows Server 2003.

    Regards :)
     
    yugolancer, Aug 13, 2007 IP