Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create file object - doesn't create anything!!

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
Hello!!
I'd really apreciate any help on this... I've spent hours and it doesn't go anywhere...
There is no bug, but, the file is not created (or updated if it's there)... basically, nothing happens...
The code is:
Dim Fso
Dim fileObject
dim f
const ForWriting = 2
const TristateTrue = 0
Set fso = CreateObject("Scripting.FileSystemObject")


If FSO.FileExists("c:\test.inc") then
Set fileObject = fso.GetFile("c:\test.inc")
set f = fileObject.OpenAsTextStream (ForWriting,TristateTrue)
f.write result

Else
set fileObject = fso.CreateTextFile("c:\test.inc", TristateTrue)
Set f = fso.OpenTextFile("c:\test.inc", ForWriting, TristateTrue)
f.Write result

fileObject.Close

Response.Write f.name & " file created"
End If
Set FSO = Nothing

Thank you sooo much!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top