P
Paul
In one place in my project, I need to create a text file. Each time it runs
it should overwrite the previous version. I use the following code and it
works fine:
FileLoc = server.MapPath("list.txt")
Set fsTemp = server.CreateObject("Scripting.FileSystemObject")
Set RecordsFile = fsTemp.CreateTextFile(FileLoc,true)
RecordsFile.WriteLine(RecCache)
RecordsFile.Close
In another page in the same project, I need to create a logfile of certain
transactions, so each time it needs to append to the end of the file. This
code results in an error 5.
FileLoc = server.MapPath("DBLog.txt")
Set fsTemp = server.CreateObject("Scripting.FileSystemObject")
Set RecordsFile = fsTemp.OpenTextFile(FileLoc, ForAppending, True)
RecordsFile.WriteLine(strSQL)
RecordsFile.Close
Can you point out what I am doing wrong?
Thanks.
Paul
it should overwrite the previous version. I use the following code and it
works fine:
FileLoc = server.MapPath("list.txt")
Set fsTemp = server.CreateObject("Scripting.FileSystemObject")
Set RecordsFile = fsTemp.CreateTextFile(FileLoc,true)
RecordsFile.WriteLine(RecCache)
RecordsFile.Close
In another page in the same project, I need to create a logfile of certain
transactions, so each time it needs to append to the end of the file. This
code results in an error 5.
FileLoc = server.MapPath("DBLog.txt")
Set fsTemp = server.CreateObject("Scripting.FileSystemObject")
Set RecordsFile = fsTemp.OpenTextFile(FileLoc, ForAppending, True)
RecordsFile.WriteLine(strSQL)
RecordsFile.Close
Can you point out what I am doing wrong?
Thanks.
Paul