I am just beginning with asp and have gotten an error that I need some
help with. I posted a pair of files to an online ASP host server. The
files are in the same directory; one is readfile.asp which should open
the other which is a simple text file - newText.txt .
Here is readfile.asp :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Reading Text Files</title>
</head>
<body>
<b>An Example of reading a .txt file and hopefully adding some
formatting.</b>
<hr>
<%
set tfile=Server.CreateObject("Scripting.FileSystemObject")
set TFStream=tfile.OpenTextFile("newText.txt")
textprinter=TFStream.readall()
%>
<p>
<%=textprinter%>
</body>
</html>
Here is the error msg that results:
Microsoft VBScript runtime error '800a0035'
File not found
/Test-BDT/readfile.asp, line 13
Where line 13 is:
set tfile=Server.CreateObject("Scripting.FileSystemObject")
MY Qustions:
-Why didn't it work?
-How do I get it to work? (I suppost I could do a server side include,
but I'd like to figure out the how& why of this code first.
-I may have a path problem. Can someone point me to a good reference
about referencing path in this code?
thanks a lot, BDT