Please can someone tell me why my code isn't working.
I have changed everything 3 times and then used the code from the FAQ. However it it doesn't find the file I get the error message and when it does it does nothing.
The oVisit is just my VB Com object sub which prints to an error file. The filename is correct and it just hangs there
Code as follows
dim fsoObj, sFileName
Const ForReading = 1
Const TristateFalse = 0
sFileName = Server.MapPath ("../updates/csv/CustomerRecords.txt"
oVisit.Common.logError err, "FileName="&sFileName
set fsoObj = Server.CreateObject("Scripting.FileSystemObject"
if fsoObj.fileExists(sFileName) then
dim objTextFile
set objTextFile = fsoObj.OpenTextFile(sFileName)
while not objTextFile.AtEndOfStream
strBuffer = objTextFile.ReadLine
oVisit.Common.logError err, "File Found Hurrah" & strBuffer
wend
objTextFile.close
set objTextFile = nothing
else
oVisit.Common.logError err, "Just call me rubbish"
end if
set fsoObj = nothing
I have changed everything 3 times and then used the code from the FAQ. However it it doesn't find the file I get the error message and when it does it does nothing.
The oVisit is just my VB Com object sub which prints to an error file. The filename is correct and it just hangs there
Code as follows
dim fsoObj, sFileName
Const ForReading = 1
Const TristateFalse = 0
sFileName = Server.MapPath ("../updates/csv/CustomerRecords.txt"
oVisit.Common.logError err, "FileName="&sFileName
set fsoObj = Server.CreateObject("Scripting.FileSystemObject"
if fsoObj.fileExists(sFileName) then
dim objTextFile
set objTextFile = fsoObj.OpenTextFile(sFileName)
while not objTextFile.AtEndOfStream
strBuffer = objTextFile.ReadLine
oVisit.Common.logError err, "File Found Hurrah" & strBuffer
wend
objTextFile.close
set objTextFile = nothing
else
oVisit.Common.logError err, "Just call me rubbish"
end if
set fsoObj = nothing