Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Location
    New Zealand
    Posts
    9

    Unanswered: 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:
    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?

  2. #2
    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".

  3. #3
    Join Date
    Jul 2003
    Location
    New Zealand
    Posts
    9

    Re: Problem in my hit counter

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •