![]() |
|
|
+ Search |
![]()
|
Jul 17th, 2000 05:25
unknown unknown, Darren Hoefgen
Problem:
How does one check to see if a text file exists (on the server in the
current directory) and if it exists then append to it, else, if it does
not exist, create it and write a record to it.
Solution:
Set fs = CreateObject("Scripting.FileSystemObject")
if fs.fileexists(FILENAMEANDPATH) then
Set f = fs.OpenTextFile("c:\testfile.txt",
ForAppending,TristateFalse)
else
Set f = fs.CreateTextFile("c:\testfile.txt", True)
end if
fs.writeline(BLAH)
fs.close
set fs = nothing
set f = nothing
something similar to that -- used code from MSDN -- check it out for
yourself http://msdn.microsoft.com/library/default.asp
© 1999-2004 Synop Pty Ltd