Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 DTS Export - Prompt For File Name

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-01-21 : 12:05:59
Mike writes "I am exporting a recordset from a SQL Table to a text file using SQL 2000 and the DTS export feature. I would like to be able to specify the file name to save the export too, as this name will change with each export occurence from the SQL Table. The following is the code which I have written, but it's missing something. Can you help?

Dim oPkg, oConn, strFolder, strFile

StrFolder = "C:\Export Files\"
strFile = inputbox("Enter file name")

Set oPkg = DTSGlobalVariables.Parent
Set oConn = oPkg.Connections("connection 2")
oConn.DataDestination = strFolder & strFile

Function Main()
Main = DTSTaskExecResult_Success
End Function
---
I have this set as an ActiveX in addition to the "connection 1"-SQL Table - and "connection 2"- Text File

Thanks
Mike"
   

- Advertisement -