Hi Carolyn
im having a problem with the script, in ssis 2005 it works 100%, as soon as i try it in my 2008 environment it does not find dts.variable object? any idea why this could be?
this is the script im using but it does not recognise dts.variable
just a note in the script task i have to selcet visual basic 2008 and not .net as it is not available but that shouldnt make a difference.
Imports System
Imports System.Data.OleDb
Imports System.IO
Imports Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptObjectModel
Imports Microsoft.SqlServer.Dts.Runtime
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
strMonth = "0" + strDay
End If
If Len(strMonth) = 1 Then
strMonth = "0" + strMonth
End If
FileDate = strYear + strMonth + strDay
OutFileName = "Archive" + FileDate + ".zip"
OutExecutable = " a -tzip """ + OutFolder + OutFileName + """ """ + InFolder + "*." + InFileType + """"
OutSubject = "Attached Zipped Files:- " + OutFileName
OutMessage = "Add your message here"
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