Permission Denied on OpenTextfile

Discussion in 'Classic ASP' started by Jamesmclellan, Sep 21, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,

    I'm getting a "permission denied" error on the OpenTextfile line of the following ASP code:

    <%
    Dim fs, fname
    set fs=Server.CreateObject("Scripting.FileSystemObject")
    set fname=fs.OpenTextFile("ideas.csv",1,true)
    fname.WriteLine("Hello World!")
    fname.Close
    set fname=nothing
    set fs=nothing
    %>

    This code is cut-and-paste from W3Schools; it's my first app in ASP.

    I've tried readmode, writemode, and appendmode; so I believe it's an issue with something other than mode.

    Help?
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Try this instead

    set fname=fs.OpenTextFile(server.mappath("\ideas.csv"),1,true)
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page