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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read a text file

Status
Not open for further replies.

rondavid

Programmer
Apr 29, 2003
19
US
Hello everyone. Im a newbie. Can anyone tell me whats wrong with this code:
<%@ Language=VBScript %>
<%
Dim fso,f,datapath,rline,current
Dim aTxt(10)
Dim aTxtA(10)
datapath = Server.MapPath(&quot;events.txt&quot;)
'Response.Write datapath
Set f = fso_OpenTextFile(datapath,1)
Do While f.AtEndOfStream <> True
rline= f.ReadLine
if IsNumeric(rline) then
current = cint(rline)
else
if IsDate(rline) then
aTxt(Current) = rline
else
aTxtA(Current) = rline
end if
end if
loop
f.Close
%>
<HTML>
<HEAD>
<META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;>
</HEAD>
<BODY>

<P><IMG alt=&quot;&quot;
src=&quot;file://C:\SourceCodeTechnologies\Projects\AVM Technologies\Web stuff\images\eventsguy.jpg&quot;></P>

</BODY>
</HTML>

I keeping it simple so I can learn, but this keeps giving me HTTP 500 Internal Server Error. Thanks
 
you're not creating a FSO object. Also place the code in the body section.


_________________________________________________________
for the best results to your questions: FAQ333-2924
[sub]01001111 01101110 01110000 01101110 01110100[/sub]
onpnt2.gif
[sup] [/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top