Right I have got the following code, that seems to be hanging our server for some unknown reason. the files that it is looking for exist and they are in the right directory. when I run this code it gets as far as the OpenTextFile line and then does absolutly nothing, does anyone know what could be wrong with this line, can you see anything that i am doing wrong somewhere else?
thanks in advance for any help !
filepath = "srchdir/" & rs("filename"
sFileName = Server.MapPath (filepath)
set fsoObj = Server.CreateObject "Scripting.FileSystemObject"
if fsoObj.fileExists(sFileName) then
set objTextFile = fsoObj.OpenTextFile(sFileName)
while not objTextFile.AtEndOfStream
lineval = objTextFile.ReadLine
if Left(lineval,5) = "#####" then
linelen = Len(lineval)
linkval = Right(lineval, (linelen-5))
end if
if Left(lineval,5) = "%%%%%" then
linelen = Len(lineval)
headval = Right(lineval, (linelen-5))
end if
wend
objTextFile.close
set objTextFile = nothing
set fsoObj = nothing
end if
thanks in advance for any help !
filepath = "srchdir/" & rs("filename"
sFileName = Server.MapPath (filepath)
set fsoObj = Server.CreateObject "Scripting.FileSystemObject"
if fsoObj.fileExists(sFileName) then
set objTextFile = fsoObj.OpenTextFile(sFileName)
while not objTextFile.AtEndOfStream
lineval = objTextFile.ReadLine
if Left(lineval,5) = "#####" then
linelen = Len(lineval)
linkval = Right(lineval, (linelen-5))
end if
if Left(lineval,5) = "%%%%%" then
linelen = Len(lineval)
headval = Right(lineval, (linelen-5))
end if
wend
objTextFile.close
set objTextFile = nothing
set fsoObj = nothing
end if