If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Problem in my hit counter

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-17-03, 20:37
Scrowler Scrowler is offline
Registered User
 
Join Date: Jul 2003
Location: New Zealand
Posts: 9
Problem in my hit counter

Code:
<%
fp = Server.MapPath("aspcount.txt")
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(fp)
ct = Clng(a.ReadLine)
if Session("ct") = "" then
Session("ct") = ct
ct = ct + 1
a.close
Set a = fs.CreateTextFile(fp, True)
a.WriteLine(ct)
end if 
a.Close
Response.Write ct
%>
I get the error:
Quote:
Microsoft VBScript runtime error '800a0046'

Permission denied

/scrowler/default.asp, line 100
Line 100 happens to be:
Code:
Set a = fs.CreateTextFile(fp, True)
Do I have to CHMOD aspcount.txt or something?
Reply With Quote
  #2 (permalink)  
Old 07-23-03, 01:26
Memnoch1207 Memnoch1207 is offline
Registered User
 
Join Date: Jan 2003
Location: Midwest
Posts: 138
set the permissions for the "Everyone" account on the folder where the aspcount.txt file is stored to "Full Control".
Reply With Quote
  #3 (permalink)  
Old 07-24-03, 04:16
Scrowler Scrowler is offline
Registered User
 
Join Date: Jul 2003
Location: New Zealand
Posts: 9
Re: Problem in my hit counter

Quote:
Originally posted by Scrowler
Code:
<%
fp = Server.MapPath("aspcount.txt")
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(fp)
ct = Clng(a.ReadLine)
if Session("ct") = "" then
Session("ct") = ct
ct = ct + 1
a.close
Set a = fs.CreateTextFile(fp, True)
a.WriteLine(ct)
end if 
a.Close
Response.Write ct
%>
I get the error:


Line 100 happens to be:
Code:
Set a = fs.CreateTextFile(fp, True)
Do I have to CHMOD aspcount.txt or something?
Thanks
Your the only person on this forum who can help me
yet theres 3 or more on codingforums.com and oxyscripts.com/forums who help me ASAP. This forum sucks.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On