|
 |
asp_databases thread: Text streaming
Message #1 by Simon Newton <simonn@h...> on Tue, 9 Oct 2001 13:19:19 +1000
|
|
Hi Guys,
could you all have a look at the code below.. thanks.. now could one of you
smack me on the back of the head and tell me how stupid ive been.. cause
something is stopping it from working.. and i dunno what!!!! and there is a
"Hervey Bay" line in the text, The dumb thing is this has worked before on a
different text file... also it throws no error...
dim txtpath, txtopenfile, txtfso, txtloc
txtpath = server.mappath ("idq10080.txt")
set txtfso = _
server.createobject("scripting.filesystemobject")
set txtopenfile = _
txtfso.opentextfile(txtpath,1)
do while not txtopenfile.atendofstream
txtloc = trim(txtopenfile.readline)
if txtopenfile.readline = "Hervey Bay" then
response.write txtopenfile.readline
response.write "<br>"
response.write txtopenfile.readline
response.write "<br>"
response.write txtopenfile.readline
response.write "<br>"
response.write txtopenfile.readline
response.write "<br>"
end if
loop
txtopenfile.close
set txtopenfile = nothing
set txtfso = nothing
set txtpath = nothing
Message #2 by David Cameron <dcameron@i...> on Tue, 9 Oct 2001 14:52:31 +1000
|
|
What is the error message. Then we can smack you on the back of your head
:-).
regards
David Cameron
nOw.b2b
Message #3 by David Cameron <dcameron@i...> on Tue, 9 Oct 2001 15:16:28 +1000
|
|
Oops. I re-read your message again and saw 'also it throws no error'.
I take it that the text file is in the same directory as the ASP page? From
what I understand of the documentation that I have you would get back a path
to a non-existant file. If you include '/' or '\' at the start of the path
it takes that as web root, otherwise it returns a relative path.
Does the text file have any information in it?
regards
David Cameron
nOw.b2b
Message #4 by Simon Newton <simonn@h...> on Tue, 9 Oct 2001 15:31:04 +1000
|
|
Its Ok guys figured it out.. used a INStr to cut out some CHR crap.
cheers anyways
-----Original Message-----
From: David Cameron [mailto:dcameron@i...]
Sent: Tuesday, 9 October 2001 3:16
To: ASP Databases
Subject: [asp_databases] RE: Text streaming
Oops. I re-read your message again and saw 'also it throws no error'.
I take it that the text file is in the same directory as the ASP page? From
what I understand of the documentation that I have you would get back a path
to a non-existant file. If you include '/' or '\' at the start of the path
it takes that as web root, otherwise it returns a relative path.
Does the text file have any information in it?
regards
David Cameron
nOw.b2b
|
|
 |