DTS Save Package dead end

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lawrence 007
    New Member
    • Nov 2006
    • 41

    DTS Save Package dead end

    Hi,

    I have a DTS package that I created. It exports data to a .csv file to my c:\ drive.

    This filepath is not always the path I want it to save the file to. How can I configure the package to ask for the save location of the file being exported?

    I am at a dead end and even an answer saying it is NOT possible would be greatly appretiated.



    Thanks
  • iburyak
    Recognized Expert Top Contributor
    • Nov 2006
    • 1016

    #2
    You can read file name from ini file into a variable in ActiveX Script.
    Use this variable instead of a file name.

    Or you can ask for file name in an inputbox see below

    '[PHP]*************** *************** *************** *************** **********
    ' Visual Basic ActiveX Script
    '************** *************** *************** *************** *************

    Function Main()
    Dim sFileName

    sFileName = inputbox("Pleas e provide File Name", "Output file")


    Main = DTSTaskExecResu lt_Success
    End Function[/PHP]

    Good Luck.

    Comment

    • Lawrence 007
      New Member
      • Nov 2006
      • 41

      #3
      iburyak,

      Thanks, for the first time in days I see a little lite at the end of the tunnel.

      This solution is great, it is asking for the file name and the user can specify that. In the .ini file can I set the location change as well? If I want to save the file to a different location?

      This would also be very helpful.

      Thanks

      Comment

      • iburyak
        Recognized Expert Top Contributor
        • Nov 2006
        • 1016

        #4
        Sure, in ini you can have anything - source and destination.
        The thing is you have to save them into a variable in a script and use this variable instead of hard-coded location where you asked for the file name.
        Don't forget script should be your first step.

        Good Luck.

        Comment

        • Lawrence 007
          New Member
          • Nov 2006
          • 41

          #5
          Being very new to this I am going to have to ask you how? I tried to figure it out myself, but I could not get it done. I am sure it is something small I am over looking.

          Thanks

          Comment

          • iburyak
            Recognized Expert Top Contributor
            • Nov 2006
            • 1016

            #6
            Where you post c:\ drive type a variable name.
            Work with input box first you already have this code.
            Just drag and drop ActiveX Script Task. Copy\paste code I provided or modify if you wish. I assume you already have SQL Task otherwise how you did your DTS export.
            When you see two pictures in DTS design mode select script first and sql second then go to Workflow and select On Success.

            It is really hard to help with DTS because I don’t see what are you doing and everything is visual interface.

            Comment

            Working...