Append to File in ActiveX

  • hi,

    I have the following code in ActiveX in DTS. I get a VB compilation error as End Of Statement expected on the line that has the "Open" statement. Where am I going wrong?

     Open "E:\DTS_Files\Target\ValidationErrorsApp.txt" For Append As #1

     Write #1, "1"

     Close #1

  • Though this doesn't directly answer your question.  I do lots of writes to text files in my DTS packages, but I always use fso (FileSystemObject).  Files are easily created or appended.

    Const ForAppending = 8
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile("C:\FSO\ScriptLog.txt", ForAppending)
    objFile.WriteLine Now
    objFile.Close

    http://www.microsoft.com/technet/scriptcenter/guide/sas_scr_hujq.mspx

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply