How do you open a file for appending data?



Hi,
I am trying to write data from SEVERAL tables in an Access application into
a SINGLE text file, using the VBA code and the keyword "ForAppending",
without success.



The following code with the keyword "ForAppending" does not just function,
despite the VBA Help presents it as example:



Sub OpenTextFileTest

Const ForReading = 1, ForWriting = 2, ForAppending = 3

Dim fs, f



Set fs = CreateObject("Scripting.FileSystemObject")



' HERE IS THE STATEMENT THAT DOESN'T FUNCTION::

Set f = fs.OpenTextFile("c:\testfile.txt", ForAppending,TristateFalse)



f.Write "Hello world!"

f.Close

End Sub



How can I go around this problem?
I am using Windows XP Pro SP2 and MS Access 2003 SP2



Ragards
M Shafaat





.



Relevant Pages

  • How do you open a file for appending data?
    ... a SINGLE text file, using the VBA code and the keyword "ForAppending", ... The following code with the keyword "ForAppending" does not just function, ... I am using Windows XP Pro SP2 and MS Access 2003 SP2 ...
    (microsoft.public.access.externaldata)
  • Re: reading file properties / keywords
    ... in what application are you writing your vba code? ... Some are usefull but no keyword ...
    (microsoft.public.scripting.vbscript)