Hi

Wonder if you can help me.

I'm running an ASP program on IIS7 Vista that will write a text file, copy
of program below

<html>
<body>

<%
dim StrFileName,fso,myfile,StrText
StrFileName=server.mappath("message.txt")
set fso=server.CreateObject("Scripting.FileSystemObject")

set myfile=fso.OpenTextFile(StrFileName,2)

StrText =("<b> Hello World </b><hr>")
myfile.Write(StrText)

myfile.close
set myfile = nothing
set fso = nothing
%>

</body>
</html>

When I run it I get the follwong error

Microsoft VBScript runtime error '800a0046'

Permission denied

/program.asp, line 14



Line 14 being

set myfile=fso.OpenTextFile(StrFileName,2)

I have looked on google and the error seems to be for different things and
not which I am having the issue with.



Would be grateful for any help

Re: IIS7 and Vista help Error writiing a text file by Bernard

Bernard
Wed Mar 12 22:02:29 CDT 2008

Obviously, the application user need to have write permission.

--
Regards,
Bernard Cheah
http://www.iis.net/
http://msmvps.com/blogs/bernard/


"Uncle Nobby" <unc@invalid.com> wrote in message
news:eZrbEhEhIHA.6084@TK2MSFTNGP06.phx.gbl...
> Hi
>
> Wonder if you can help me.
>
> I'm running an ASP program on IIS7 Vista that will write a text file, copy
> of program below
>
> <html>
> <body>
>
> <%
> dim StrFileName,fso,myfile,StrText
> StrFileName=server.mappath("message.txt")
> set fso=server.CreateObject("Scripting.FileSystemObject")
>
> set myfile=fso.OpenTextFile(StrFileName,2)
>
> StrText =("<b> Hello World </b><hr>")
> myfile.Write(StrText)
>
> myfile.close
> set myfile = nothing
> set fso = nothing
> %>
>
> </body>
> </html>
>
> When I run it I get the follwong error
>
> Microsoft VBScript runtime error '800a0046'
>
> Permission denied
>
> /program.asp, line 14
>
>
>
> Line 14 being
>
> set myfile=fso.OpenTextFile(StrFileName,2)
>
> I have looked on google and the error seems to be for different things and
> not which I am having the issue with.
>
>
>
> Would be grateful for any help
>
>
>
>