Server.CreateObject Failed


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Server.CreateObject Failed

  1. #1
    XXOO Guest

    Server.CreateObject Failed

    Hi,
    Is there anyone there can help me out on this?
    The code I wrote on the ASP file is as following:

    dim fs, textFile
    set fs = server.createobject("Scripting.FileSystemObject")
    set textFile = fs.opentextfile("D:\temp\test.txt", forWriting, True)
    textFile.write ("Testing")
    textFile.close

    Then I got an error message:

    Server object error 'ASP 0177 : 80070057'
    Server.CreateObject Failed

    Thank you so much
    --
    Vivianne



  2. #2
    Harish Kumar Guest

    Re: Server.CreateObject Failed


    Hi,

    See whether this helps -

    -------------------------------------
    'Declare a constant for IOMode solved
    Const ForWriting = 2
    dim fso, txtFile

    on Error Resume Next
    set fso = server.createobject("Scripting.FileSystemObject")

    if Err.Number = 0 then
    set txtFile = fs.opentextfile("D:\temp\test.txt", ForWriting, True)
    txtFile.write ("Testing")
    txtFile.close
    else
    'Error Handling Routine

    end if
    -------------------------------------

    Harish Mohanbabu


    "XXOO" <vivianne@strongjewel.com> wrote:
    >Hi,
    > Is there anyone there can help me out on this?
    >The code I wrote on the ASP file is as following:
    >
    >dim fs, textFile
    >set fs = server.createobject("Scripting.FileSystemObject")
    >set textFile = fs.opentextfile("D:\temp\test.txt", forWriting, True)
    >textFile.write ("Testing")
    >textFile.close
    >
    >Then I got an error message:
    >
    >Server object error 'ASP 0177 : 80070057'
    >Server.CreateObject Failed
    >
    >Thank you so much
    >--
    >Vivianne
    >
    >



  3. #3
    Paul Clement Guest

    Re: Server.CreateObject Failed

    On Fri, 27 Sep 2002 15:10:59 -0700, "XXOO" <vivianne@strongjewel.com> wrote:

    Hi,
    Is there anyone there can help me out on this?
    The code I wrote on the ASP file is as following:

    dim fs, textFile
    set fs = server.createobject("Scripting.FileSystemObject")
    set textFile = fs.opentextfile("D:\temp\test.txt", forWriting, True)
    textFile.write ("Testing")
    textFile.close

    Then I got an error message:

    Server object error 'ASP 0177 : 80070057'
    Server.CreateObject Failed

    Thank you so much

    Which line of code was identified in the error?

    It's likely a permissions issue on the file, but I don't know whether you received the error
    creating the Scripting.FileSystemObject, or when you executed the OpenTextfile method.


    Paul ~~~ pclement@ameritech.net
    Microsoft MVP (Visual Basic)

  4. #4
    XXOO Guest

    Re: Server.CreateObject Failed

    Thank you so much!
    It happened when I execute the openTextFile method. But, I found the main
    reason why it failed was the norton aniti-virus. It blocked the script;
    therefore, the program can not run through!



    "Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
    news:7o0hpuc3hgnp1rl9dlviha9a6kvjd01eb8@4ax.com...
    > On Fri, 27 Sep 2002 15:10:59 -0700, "XXOO" <vivianne@strongjewel.com>

    wrote:
    >
    > Hi,
    > Is there anyone there can help me out on this?
    > The code I wrote on the ASP file is as following:
    >
    > dim fs, textFile
    > set fs = server.createobject("Scripting.FileSystemObject")
    > set textFile = fs.opentextfile("D:\temp\test.txt", forWriting, True)
    > textFile.write ("Testing")
    > textFile.close
    >
    > Then I got an error message:
    >
    > Server object error 'ASP 0177 : 80070057'
    > Server.CreateObject Failed
    >
    > Thank you so much
    >
    > Which line of code was identified in the error?
    >
    > It's likely a permissions issue on the file, but I don't know whether you

    received the error
    > creating the Scripting.FileSystemObject, or when you executed the

    OpenTextfile method.
    >
    >
    > Paul ~~~ pclement@ameritech.net
    > Microsoft MVP (Visual Basic)




  5. #5
    John Goad Guest

    Re: Server.CreateObject Failed


    Its not permissions, but instead an incorrect example by Microsoft. Try this:

    <SCRIPT LANGUAGE="VBScript" RUNAT=SERVER>
    <%
    dim fs, textFile
    Set fs = CreateObject("Scripting.FileSystemObject")
    set textFile = fs.opentextfile("D:\temp\test.txt", forWriting, True)textFile.write
    ("Testing")
    textFile.close
    %>
    </Script>

    John. <johngoad1@msn.com>
    Sr. Programmer Analyst (VB,VB.NET)

    Paul Clement <UseAdddressAtEndofMessage@swspectrum.com> wrote:
    >On Fri, 27 Sep 2002 15:10:59 -0700, "XXOO" <vivianne@strongjewel.com> wrote:
    >
    > Hi,
    > Is there anyone there can help me out on this?
    > The code I wrote on the ASP file is as following:
    >
    > dim fs, textFile
    > set fs = server.createobject("Scripting.FileSystemObject")
    > set textFile = fs.opentextfile("D:\temp\test.txt", forWriting, True)
    > textFile.write ("Testing")
    > textFile.close
    >
    > Then I got an error message:
    >
    > Server object error 'ASP 0177 : 80070057'
    > Server.CreateObject Failed
    >
    > Thank you so much
    >
    >Which line of code was identified in the error?
    >
    >It's likely a permissions issue on the file, but I don't know whether you

    received the
    >error
    >creating the Scripting.FileSystemObject, or when you executed the OpenTextfile

    method.
    >
    >
    >Paul ~~~ pclement@ameritech.net
    >Microsoft MVP (Visual Basic)



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center