Codigo:
Código:
Dim oStep As DTS.Step Dim oTask As DTS.Task Dim oExecPkg As DTS.ExecutePackageTask On Error GoTo PackageError 'Crear el paso y la tarea. Especificar el paquete a correr, y enlazarlo al paso de la tarea Set oStep = oPackage.Steps.New Set oTask = oPackage.Tasks.New("DTSExecutePackageTask") Set oExecPkg = oTask.CustomTask With oExecPkg .Name = "ExecPkgTask" .ServerUserName = "sa" .ServerName = "(local)" .UseTrustedConnection = False ' .ServerPassword = .FileName = sDTSPackagePathAndFileName End With With oStep .TaskName = oExecPkg.Name .Name = "ExecPkgStep" .ExecuteInMainThread = True End With 'Agregar el paso oPackage.Steps.Add oStep oPackage.Tasks.Add oTask ' cmdExecute.Enabled = False 'Ejecutar el paquete oPackage.Execute