PDA

View Full Version : asp 800a004c error


dizzy1
09-20-2007, 04:25 PM
Im getting a error when trying to write to a txt file.

dim fs,tfile
set fs=Server.CreateObject("Scripting.FileSystemObject")
set tfile=fs.CreateTextFile("E:\www\NMBSTV\Prototype\somefile.txt")


tfile.WriteLine(ful)
tfile.close
set tfile=nothing
set fs=nothing

Its so annoying i got it working on my test server and then moved it to another server and it gives this error i think it could be perrmisions but ive gave the folder read write permisions.

jleone
09-20-2007, 05:10 PM
Not sure what "ful" is that you are trying to write to the file. Is this a string variable declared somewhere else?

I currently have the following code in an app that works. Feel free to give it a try.

Dim WriteStream As System.IO.StreamWriter

WriteStream = System.IO.File.CreateText("Your filename")

WriteStream.WriteLine("Your text")

WriteStream.Close()

If WriteStream IsNot Nothing Then
WriteStream.Dispose()
WriteStream.Close()
WriteStream = Nothing
End If