Server.CreateObject error


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Server.CreateObject error

  1. #1
    Dana Guest

    Server.CreateObject error


    Okay I've been wrestling with this one for a while and I'm frustrated.
    I'm posting a form to an asp page to process it and save the answers to
    a text file on the server. The code I'm using (thanks Andrew!) read something
    like this:

    ----------------------------------------

    <%@ LANGUAGE="VBSCRIPT" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Form Process</title>
    </head>

    <body bgcolor="#FFFFFF" text="#000000">
    <%
    If Request.Form("Contact_YAcct") = "" then
    Response.Write("Please click the Back button on your browser and input
    your agency's Y-Account. Thank you.")
    Else
    strFile = "/Survey/agency1.txt"

    For Each x In Request.Form
    strData = strData & vbTab & "" & Request.Form(x) & ""
    Next

    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objTextStream = objFSO.OpenTextFile(strFile,ForAppending,True)

    objTextStream.WriteLine strData
    objTextStream.Close
    Set objTextStream = Nothing
    Set objFSO = Nothing

    Response.Write("Thank you for taking the time to submit this survey! We
    sincerely appreciate your input!")

    End If
    %>
    <A href="login.asp">Click here to return to the Login.</A>
    </body>
    </html>

    ------------------------

    The error I'm getting when I post the form is:

    -------------------

    Server object error 'ASP 0177 : 80070057'

    Server CreateObject Failed

    /agsurvpost.asp, line 20

    The operation completed successfully.

    -------------------

    The error points to the line

    Set objTextStream = objFSO.OpenTextFile(strFile,ForAppending,True)

    I've checked syntax on the OpenTextFile function over an over and everything
    seems okay.

    The destination file exists, the directory its in has Read, Write, and Execute
    through IIS.. I even set the NTFS permissions on that directory to Everyone
    All/All.

    I looked up ASP 0177 errors as related to CreateObject.. and it talks about
    making sure the permissions exist on the server and whatnot, but I cannot
    think of anything else to check.. hence.. I'm stuck with an error... when
    it says it completed successfully?? (and no, it didn't touch the file).

    Ideas?

    Thanks guys..
    -dana


  2. #2
    Adrian Forbes Guest

    Re: Server.CreateObject error

    Have you defined ForAppending?

    Dana <dana.sims@ivans.com> wrote in message news:39abd1d2@news.devx.com...
    >
    > Okay I've been wrestling with this one for a while and I'm frustrated.
    > I'm posting a form to an asp page to process it and save the answers to
    > a text file on the server. The code I'm using (thanks Andrew!) read

    something
    > like this:
    >
    > ----------------------------------------
    >
    > <%@ LANGUAGE="VBSCRIPT" %>
    > <html>
    > <head>
    > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    > <title>Form Process</title>
    > </head>
    >
    > <body bgcolor="#FFFFFF" text="#000000">
    > <%
    > If Request.Form("Contact_YAcct") = "" then
    > Response.Write("Please click the Back button on your browser and input
    > your agency's Y-Account. Thank you.")
    > Else
    > strFile = "/Survey/agency1.txt"
    >
    > For Each x In Request.Form
    > strData = strData & vbTab & "" & Request.Form(x) & ""
    > Next
    >
    > Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    > Set objTextStream = objFSO.OpenTextFile(strFile,ForAppending,True)
    >
    > objTextStream.WriteLine strData
    > objTextStream.Close
    > Set objTextStream = Nothing
    > Set objFSO = Nothing
    >
    > Response.Write("Thank you for taking the time to submit this survey! We
    > sincerely appreciate your input!")
    >
    > End If
    > %>
    > <A href="login.asp">Click here to return to the Login.</A>
    > </body>
    > </html>
    >
    > ------------------------
    >
    > The error I'm getting when I post the form is:
    >
    > -------------------
    >
    > Server object error 'ASP 0177 : 80070057'
    >
    > Server CreateObject Failed
    >
    > /agsurvpost.asp, line 20
    >
    > The operation completed successfully.
    >
    > -------------------
    >
    > The error points to the line
    >
    > Set objTextStream = objFSO.OpenTextFile(strFile,ForAppending,True)
    >
    > I've checked syntax on the OpenTextFile function over an over and

    everything
    > seems okay.
    >
    > The destination file exists, the directory its in has Read, Write, and

    Execute
    > through IIS.. I even set the NTFS permissions on that directory to

    Everyone
    > All/All.
    >
    > I looked up ASP 0177 errors as related to CreateObject.. and it talks

    about
    > making sure the permissions exist on the server and whatnot, but I cannot
    > think of anything else to check.. hence.. I'm stuck with an error... when
    > it says it completed successfully?? (and no, it didn't touch the file).
    >
    > Ideas?
    >
    > Thanks guys..
    > -dana
    >




  3. #3
    Dana Guest

    Re: Server.CreateObject error


    Duh. Duh. Duh.

    Okay.. someone get in a car, drive to Florida, and shoot me.

    =)

    Thanks Adrian.


    "Adrian Forbes" <adrian.forbes@spamless.ntli.net> wrote:
    >Have you defined ForAppending?
    >
    >Dana <dana.sims@ivans.com> wrote in message news:39abd1d2@news.devx.com...
    >>
    >> Okay I've been wrestling with this one for a while and I'm frustrated.


    >> I'm posting a form to an asp page to process it and save the answers

    to
    >> a text file on the server. The code I'm using (thanks Andrew!) read

    >something
    >> like this:
    >>
    >> ----------------------------------------
    >>
    >> <%@ LANGUAGE="VBSCRIPT" %>
    >> <html>
    >> <head>
    >> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    >> <title>Form Process</title>
    >> </head>
    >>
    >> <body bgcolor="#FFFFFF" text="#000000">
    >> <%
    >> If Request.Form("Contact_YAcct") = "" then
    >> Response.Write("Please click the Back button on your browser and input
    >> your agency's Y-Account. Thank you.")
    >> Else
    >> strFile = "/Survey/agency1.txt"
    >>
    >> For Each x In Request.Form
    >> strData = strData & vbTab & "" & Request.Form(x) & ""
    >> Next
    >>
    >> Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    >> Set objTextStream = objFSO.OpenTextFile(strFile,ForAppending,True)
    >>
    >> objTextStream.WriteLine strData
    >> objTextStream.Close
    >> Set objTextStream = Nothing
    >> Set objFSO = Nothing
    >>
    >> Response.Write("Thank you for taking the time to submit this survey!

    We
    >> sincerely appreciate your input!")
    >>
    >> End If
    >> %>
    >> <A href="login.asp">Click here to return to the Login.</A>
    >> </body>
    >> </html>
    >>
    >> ------------------------
    >>
    >> The error I'm getting when I post the form is:
    >>
    >> -------------------
    >>
    >> Server object error 'ASP 0177 : 80070057'
    >>
    >> Server CreateObject Failed
    >>
    >> /agsurvpost.asp, line 20
    >>
    >> The operation completed successfully.
    >>
    >> -------------------
    >>
    >> The error points to the line
    >>
    >> Set objTextStream = objFSO.OpenTextFile(strFile,ForAppending,True)
    >>
    >> I've checked syntax on the OpenTextFile function over an over and

    >everything
    >> seems okay.
    >>
    >> The destination file exists, the directory its in has Read, Write, and

    >Execute
    >> through IIS.. I even set the NTFS permissions on that directory to

    >Everyone
    >> All/All.
    >>
    >> I looked up ASP 0177 errors as related to CreateObject.. and it talks

    >about
    >> making sure the permissions exist on the server and whatnot, but I cannot
    >> think of anything else to check.. hence.. I'm stuck with an error... when
    >> it says it completed successfully?? (and no, it didn't touch the file).
    >>
    >> Ideas?
    >>
    >> Thanks guys..
    >> -dana
    >>

    >
    >



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