FSO Object (Write Access Issues)

From: Brian (lord03000_at_hotmail.com)
Date: 07/28/04


Date: Tue, 27 Jul 2004 17:53:49 -0700

I have IIS 5.1 on Win XP Pro SP1. I'm trying to use ASP's
FSO Object to write to a file, but it never works.
Everytime I open the page, it just sits there, I wait and
wait, then it gives me an operation Timeout Message. I've
checked over the settings in IIS over and over again to
make sure I have write access, but for some reason it
just doesn't work.

Here is my ASP code
(C:\inetpub\wwwroot\lpctech\welcome.asp):
<%
'START OF CODE
Dim objFSO
Dim strPath
Dim intCount

strPath = Server.MapPath(strWritePath & "\hitCount.txt")
Set objFSO = Server.CreateObject
("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strPath, ForReading,
True, TristateFalse)
intCount = int(objFile.ReadLine)
objFile.Close
intCount = intCount + 1
Set objFile = objFSO.OpenTextFile(strPath, ForWriting,
True, TristateFalse)
objFile.Write intCount
objFile.Close
'END OF CODE
%>

Explaination: What I'm trying to do here is a simple file
based hit counter.

strWritePath is a string set in include.asp which is
included in the file.

Here is what it is in there:
strWritePath = Server.MapPath(.\db)

Which translates to:
C:\Inetpub\wwwroot\lpctech\db

What the code does is open a file (hitcount.txt) which
just has a number. It reads that number, converts it into
an interger, increments it, and writes it back into the
file.

I've tested this script on my website (hosted by someone
else) and it works without a problem. It has a problem
with my computer.

If you have any idea what's wrong, please tell me.
email: lord03000@hotmail.com
Thanks in advance for any help.



Relevant Pages

  • Re: FSO Object (Write Access Issues)
    ... >FSO Object to write to a file, ... >Dim strPath ... >Set objFile = objFSO.OpenTextFile(strPath, ForReading, ... >intCount = int ...
    (microsoft.public.inetserver.iis.security)
  • Re: Automating search for words in a website using WSH
    ... Dim oIE 'Internet Explorer Object ... ' Document Object Model of the loaded web page. ... I will need to get the value of intCount: ... set objWshShell = wscript.createobject ...
    (microsoft.public.scripting.wsh)
  • Re: Automating search for words in a website using WSH
    ... Dim oIE 'Internet Explorer Object ... ' Document Object Model of the loaded web page. ... dim strTo, strCc, strText, strDate, strIncrease, strMessage, intCount, ... set objWshShell = wscript.createobject ...
    (microsoft.public.scripting.wsh)
  • Re: Addnew method/Dynamic Array
    ... It is much more efficient than my function by adding the batch number ... I have also included the AssignBatch procedure as ... Dim qdf As DAO.QueryDef ... Dim intCount As Integer ...
    (microsoft.public.access.modulesdaovba)
  • Re: Report has 126 pages and take forever to run
    ... The query runs in 1 second, but the report still takes 25 seconds. ... Dim intCount As Integer ...
    (microsoft.public.access.reports)