PDA

Click to See Complete Forum and Search --> : Could someone please help me with this?


Zaphod64831
Oct 1st, 2000, 08:17 PM
I have some code here, and when I run it on my FTP server it says that it can't create the FileSystemObject, can someone please debug it for me? I've separated the buggy line from the rest to help.


<Script language="VBScript" RUNAT="Server">
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim Visitor, fso, MyFile, Data,

Set fso = CreateObject("Scripting.FileSystemObject")

Set MyFile = fso.OpenTextFile("testfile.txt", ForReading, True)
Data = MyFile.ReadLine
Visitor = CInt(Data)
Visitor = Visitor + 1
Document.Write "<h1>" & Visitor & "</h1>"
MyFile.Close
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.OpenTextFile("testfile.txt", ForWriting, True)
MyFile.Write Visitor
MyFile.Close
</Script>

Mark Sreeves
Oct 2nd, 2000, 07:06 AM
FTP server??

with a few tweaks it runs on PWS ok.


<%@ Language=VBScript %>
<%option explicit%>
<HTML>

<BODY>
<%
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim Visitor, fso, MyFile, Data

Set fso = CreateObject("Scripting.FileSystemObject")

Set MyFile = fso.OpenTextFile("c:\testfile.txt", ForReading, True)
Data = MyFile.ReadLine
Visitor = CInt(Data)
response.Write "<h1>" & Visitor & "</h1>"
MyFile.Close
Visitor = Visitor + 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.OpenTextFile("c:\testfile.txt", ForWriting, True)
MyFile.Write Visitor
MyFile.Close

%>

</BODY>
</HTML>