Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSIS Help Expand / Collapse
Author
Message
Posted Thursday, October 13, 2011 10:22 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 6, 2012 11:34 AM
Points: 3, Visits: 18
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
Post #1190027
Posted Thursday, October 13, 2011 11:26 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Thursday, December 18, 2014 9:58 AM
Points: 13,872, Visits: 9,600
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
Post #1190086
Posted Thursday, October 13, 2011 11:33 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 6, 2012 11:34 AM
Points: 3, Visits: 18
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
Post #1190091
Posted Thursday, October 13, 2011 12:02 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Thursday, December 18, 2014 9:58 AM
Points: 13,872, Visits: 9,600
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
Post #1190109
Posted Thursday, October 13, 2011 1:34 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 6, 2012 11:34 AM
Points: 3, Visits: 18
Thank you! Everything is working great now!
Post #1190166
Posted Thursday, October 13, 2011 1:53 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Thursday, December 18, 2014 9:58 AM
Points: 13,872, Visits: 9,600
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
Post #1190179
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse