I'm a Newbie

R

Ronin

Hi people,

Tonight I started writing my first program, a 'counter' ASP program, but hit
the error Microsoft VBScript runtime error '800a0046' Permission denied.

Here's my program, trimmed down to the bare essentials for your easy view.

<HTML>
<body>
<p>You are visitor <%
fp = Server.MapPath("aspcount.txt")
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(fp)
ct = Clng(a.ReadLine)
a.Close
Set a = fs.CreateTextFile(fp, True)
ct = ct + 1
a.WriteLine(ct)
a.Close
Response.Write ct
%></p>
</body>
</HTML>

The error stopped at the CreateTextFile line. I guess this is a security
issue with my webhost? My webhost claims it allows me to support ASP, so
whats wrong?

Thanks. :)

(I'm really embarassed. 9 years writing programs for big corporations and
can't solve this teeny little problem. You guys must have heard this many
times. Fingers crossed that I don't get flamed.)
 
E

Evertjan.

William Tasso wrote on 20 aug 2003 in
microsoft.public.inetserver.asp.general:
yep - permissions on the directory


ask them to allow write access.

1
Sometimes, if you have your own cgi-bin, you have write access there:

Try:

fp = Server.MapPath("/cgi-bin/aspcount.txt")

2
You will have to set the file "by hand (ftp?)" the first time

or

programmethe possibility of the file's nonexistence
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top