• You can do the file system stuff with FileSystemObjects rather than your text file:

    Dim objFso

    Set objFso = CreateObject("Scripting.FileSystemObject")

    Then see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/fsoorifilesystemobject.asp for all the nice things you can do.

    The way I used to run a query on an existing connection in an ActiveX task might not be the best, but it does work. I set up an ADO connection in the task, and then set the connection string:

    myConn.ConnectionString = "File Name=" & DTSGlobalVariables.Parent.Connections("myDB").UDLPath

    This is only going to work if the original connection is set up with a UDL, but there are other properties of the connection object which you might also read to get your ADO connection to be the same.

    Bill.