-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Subhan2003
Message 3 in Discussion

Hi,  The following is the code which I have used ,Please let me know where am I making 
mistake.  
Dim goPackageOld As New DTS.Package 
Dim goPackage As DTS.Package2 
goPackage = goPackageOld 
goPackage.Name = "PkgName" 
goPackage.WriteCompletionStatusToNTEventLog = False 
goPackage.FailOnError = False 
'goPackage.FailOnError = True 
goPackage.PackagePriorityClass = 2 
goPackage.MaxConcurrentSteps = 4 
goPackage.LineageOptions = 0 
goPackage.UseTransaction = True 
goPackage.TransactionIsolationLevel = 4096 
goPackage.AutoCommitTransaction = True 
goPackage.RepositoryMetadataOptions = 0 
goPackage.UseOLEDBServiceComponents = True 
goPackage.LogToSQLServer = False 
goPackage.LogServerFlags = 0 
goPackage.FailPackageOnLogFailure = False 
goPackage.ExplicitGlobalVariables = False 
goPackage.PackageType = 0 
goPackage.LogFileName = strLogFile 
Dim oGlobal As DTS.GlobalVariable 
oGlobal = goPackage.GlobalVariables.New("GlobalVariableName") 
oGlobal.Value = CType(GlobalVarValue, String) 
goPackage.GlobalVariables.Add(oGlobal) 
oGlobal = Nothing 
'--------------------------------------------------------------------------- 
' create package steps information 
'--------------------------------------------------------------------------- 
Dim oStep As DTS.Step2 
Dim oPrecConstraint As DTS.PrecedenceConstraint 
'------------- a new step defined below 
oStep = goPackage.Steps.New 
oStep.Name = "DTSStep_DTSExecutePackageTask_1" 
oStep.Description = "Execute Upload File" 
oStep.ExecutionStatus = 4 
oStep.TaskName = "DTSTask_DTSExecutePackageTask_1" 
oStep.CommitSuccess = False 
oStep.RollbackFailure = False 
oStep.ScriptLanguage = "VBScript" 
oStep.AddGlobalVariables = True 
oStep.RelativePriority = 3 
oStep.CloseConnection = False 
oStep.ExecuteInMainThread = False 
oStep.IsPackageDSORowset = False 
oStep.JoinTransactionIfPresent = False 
oStep.DisableStep = False 
oStep.FailPackageOnError = True 
oStep.FailPackageOnError = True 
goPackage.Steps.Add(oStep) 
oStep = Nothing 
'--------------------------------------------------------------------------- 
' create package tasks information 
'--------------------------------------------------------------------------- 
Dim oTask As DTS.Task 
Dim oLookup As DTS.Lookup 
Dim oCustomTask As DTS.ExecutePackageTask 
oTask = goPackage.Tasks.New("DTSExecutePackageTask") 
oTask.Name = "DTSTask_DTSExecutePackageTask_1" 
oCustomTask = oTask.CustomTask 
oCustomTask.Name = "DTSTask_DTSExecutePackageTask_1" 
oCustomTask.Description = "Execute Upload File" 
oCustomTask.UseTrustedConnection = True 
oCustomTask.UseRepository = False 
oCustomTask.PackageName = "TXN_Importspkg" 
oCustomTask.FileName = strDTSFileName 
oCustomTask.InputGlobalVariableNames = """GlobalVarName"";" 
goPackage.Tasks.Add(oTask) 
oCustomTask = Nothing 
oTask = Nothing 
'--------------------------------------------------------------------------- 
' Save or execute package 
'--------------------------------------------------------------------------- 
On Error GoTo PackageError 
goPackage.Execute() 
goPackage.UnInitialize() 
Thanks in advance, 
Subhan

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to