Hi,
I am using the DTS object model to create SQL Server DTS packages dynamically from VFP 6
I can create the packages and add connections no problem. However I am encountering a problem when I try to add a Task and Step to the package. The Task is not appearing when I try to view the package in the DTS Designer.
I have added the step before I tried to create the task.(Step & Task Code below)
Anyone out there with any experience in this.
Help much appreciated.
-Paul
***********************************************************
* Create SQL Task
*
PROCEDURE CreateSQLTask
PARAMETERS _Name, _Description, _SQLStatement, _ConnectionID
IF PARAMETERS() <> 4
WAIT WINDOW 'Invalid Number of Parameters'
ENDIF
oTask = oPackage.TASKS.NEW('DTSExecuteSQLTask')
oTask.Name = _Name
oTask.Description = _Description
oCustomTask = oTask.CustomTask
oCustomTask.Name = 'DTSTask_DTSExecuteSQLTask_1'
oCustomTask.Description = ''
oCustomTask.SQLStatement = _SQLStatement
oCustomTask.ConnectionID = _ConnectionID
oCustomTask.CommandTimeout = 0
oPackage.Tasks.Add(oTask)
RELEASE oTask
RETURN
***********************************************************
***********************************************************
* Create Step
*
PROCEDURE CreateStep
PARAMETERS _Name, _Description, _TaskName
oStep = oPackage.STEPS.NEW()
oStep.Name = _Name
oStep.Description = _Description
oStep.ExecutionStatus = 1
oStep.TaskName = _TaskName
oStep.CommitSuccess = .F.
oStep.RollbackFailure = .F.
oStep.ScriptLanguage = "VBScript"
oStep.AddGlobalVariables = .T.
oStep.RelativePriority = 3
oStep.CloseConnection = .F.
oStep.ExecuteInMainThread = .F.
oStep.IsPackageDSORowset = .F.
oStep.JoinTransactionIfPresent = .F.
oStep.DisableStep = .F.
oPackage.Steps.Add(oStep)
RELEASE oStep
RETURN
**********************************************************
I am using the DTS object model to create SQL Server DTS packages dynamically from VFP 6
I can create the packages and add connections no problem. However I am encountering a problem when I try to add a Task and Step to the package. The Task is not appearing when I try to view the package in the DTS Designer.
I have added the step before I tried to create the task.(Step & Task Code below)
Anyone out there with any experience in this.
Help much appreciated.
-Paul
***********************************************************
* Create SQL Task
*
PROCEDURE CreateSQLTask
PARAMETERS _Name, _Description, _SQLStatement, _ConnectionID
IF PARAMETERS() <> 4
WAIT WINDOW 'Invalid Number of Parameters'
ENDIF
oTask = oPackage.TASKS.NEW('DTSExecuteSQLTask')
oTask.Name = _Name
oTask.Description = _Description
oCustomTask = oTask.CustomTask
oCustomTask.Name = 'DTSTask_DTSExecuteSQLTask_1'
oCustomTask.Description = ''
oCustomTask.SQLStatement = _SQLStatement
oCustomTask.ConnectionID = _ConnectionID
oCustomTask.CommandTimeout = 0
oPackage.Tasks.Add(oTask)
RELEASE oTask
RETURN
***********************************************************
***********************************************************
* Create Step
*
PROCEDURE CreateStep
PARAMETERS _Name, _Description, _TaskName
oStep = oPackage.STEPS.NEW()
oStep.Name = _Name
oStep.Description = _Description
oStep.ExecutionStatus = 1
oStep.TaskName = _TaskName
oStep.CommitSuccess = .F.
oStep.RollbackFailure = .F.
oStep.ScriptLanguage = "VBScript"
oStep.AddGlobalVariables = .T.
oStep.RelativePriority = 3
oStep.CloseConnection = .F.
oStep.ExecuteInMainThread = .F.
oStep.IsPackageDSORowset = .F.
oStep.JoinTransactionIfPresent = .F.
oStep.DisableStep = .F.
oPackage.Steps.Add(oStep)
RELEASE oStep
RETURN
**********************************************************