Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FIleSystemObject problems 2

Status
Not open for further replies.

sweetleaf

Programmer
Joined
Jan 16, 2001
Messages
439
Location
CA
Good Morning,

I've included the MS Scripting Runtime project reference
and yet i get "Object doesn't support this property or method: 'atEndOfStream'" error.
I did notice that that particular method wasn't included in the intelli-sense list.
Does anyone know what i need to do?


<%

dim fs,fileName,data,ts
fileName=&quot;c:\Book25.csv&quot;
set ts = server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
set fs = ts.OpenTextFile(fileName,ForReading)

do while(not ts.atEndOfStream)
Response.Write ts.line & &quot;:&quot; & ts.readLine() & &quot;<br>&quot;
loop

ts.Close

%>

Thanks,
Mark

 
.atEndOfStream is a property of the textstream object.
You are trying to use it on a filesystemobject

------------------------------------------
MS Example
------------------------------------------

Set File = FSO.GetFile(TestFilePath & &quot;\Beatles\BathroomWindow.txt&quot;)
Set TextStream = File.OpenAsTextStream(OpenFileForReading)
Do While Not TextStream.AtEndOfStream
S = S & TextStream.ReadLine & NewLine
Loop
TextStream.Close



.
.. Eat, think and be merry .
... ....................... .
 
take care to what you write,
The line:
do while(not ts.atEndOfStream)

should be:
do while(not fs.atEndOfStream)

ts is the FileSystemObject and of course it doesn't support
atEndOfStream property.

Hope this helps, s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
thanks guys, can't believe i did that!

 
I assume you fixed the set statements,
set fs = server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
set ts = fs.OpenTextFile(fileName,ForReading)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top