03-16-06 01:47 AM
What's error 5?
Bob Lehmann
"Paul" <nospam@mydomain.com> wrote in message
news:%237J1%23uISGHA.5500@TK2MSFTNGP12.phx.gbl...
> 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
>
>
>
>
>
>
[ Post a follow-up to this message ]
|