SSIS Help

  • I have an SSIS package that I need to password protect (it can be static) can anyone help? I use 7 zip and got some code from here that currently works, I just need to enhance it

    Thank you in advance

    Joe

    Imports System

    Imports System.Data.OleDb

    Imports System.IO

    Public Class ScriptMain

    Public Sub Main()

    Dim InFolder, InFileType, OutFileName, OutExecutable, OutSubject, OutFolder, OutMessage As String

    Dim FileDate, strDay, strMonth, strYear As String

    InFolder = Trim(CStr(Dts.Variables("User::InFolder").Value))

    OutFolder = Trim(CStr(Dts.Variables("User::OutFolder").Value))

    InFileType = Trim(CStr(Dts.Variables("User::InFileType").Value))

    strDay = CStr(Day(Now))

    strMonth = CStr(Month(Now))

    strYear = CStr(Year(Now))

    If Len(strDay) = 1 Then

    strDay = "0" + strDay

    End If

    If Len(strMonth) = 1 Then

    strMonth = "0" + strMonth

    End If

    FileDate = strMonth + strDay + strYear

    OutFileName = "ApplicantExtract" + FileDate + ".zip"

    OutExecutable = " a -tzip """ + OutFolder + OutFileName + """ """ + InFolder + "*." + InFileType + """"

    OutSubject = "Attached Zipped Files:- " + OutFileName

    OutMessage = "Zipped"

    Dts.Variables("User::OutExecutable").Value = OutExecutable

    Dts.Variables("User::OutFileName").Value = OutFolder + OutFileName

    Dts.Variables("User::OutSubject").Value = OutSubject

    Dts.Variables("User::OutMessage").Value = OutMessage

    Dts.TaskResult = Dts.Results.Success

    End Sub

    End Class

  • Password protect? As in save it as a file so it can be deployed somewhere and encrypt the file? Or as in protect privileged data within the package itself, like connection strings? Or as in make it so the package can't be run without providing a password?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Im sorry, I wanted to password protect the zipfile prior to ftp ing it. the code I have zips the txt file that I have created. I wondered how I could pw protect the .zip

    Thank you again

    Joe

  • 7zip has a -p switch that allows you assign a password to an archive.

    Here's a page with samples: http://www.dotnetperls.com/7-zip-examples

    Ctrl-F "password" to find the one you need. It's a ways down the page.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Thank you! Everything is working great now!

  • You're welcome.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 6 posts - 1 through 5 (of 5 total)

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