Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DTS.Steps default Value
Message
From
23/03/2006 13:04:27
Keith Payne
Technical Marketing Solutions
Florida, United States
 
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01107050
Message ID:
01107070
Views:
21
>I am having dificulty resolving this build error:
>
>Interface 'DTS.Steps' cannot be indexed because it has no default property.
>
>This is from code directly from M$ and it does not work.
>
>
>Public Sub StepPrecedenceConstraint()
> 'Declare the step and precedence constraint.
> Dim objStep As DTS.Step
> Dim objConstraint As DTS.PrecedenceConstraint
>
> 'TransformData only runs when ClearTables completes.
>
>
> objStep = objPackage.Steps("TransformData") 'ERROR is with the Steps object
>
>
> objConstraint = objStep.PrecedenceConstraints.New("ClearTables")
> objConstraint.PrecedenceBasis = DTSStepPrecedenceBasis_ExecStatus
> objConstraint.Value = DTSStepExecStat_Completed
> objStep.PrecedenceConstraints.Add(objConstraint)
>
> 'GenerateDoc only runs when TransformData is successful.
> objStep = objPackage.Steps("GenerateDoc")
> objConstraint = objStep.PrecedenceConstraints.New("TransformData")
> objConstraint.PrecedenceBasis = DTSStepPrecedenceBasis_ExecResult
> objConstraint.Value = DTSStepExecResult_Success
> objStep.PrecedenceConstraints.Add(objConstraint)
>
> 'SendMail only runs when TransformData fails.
> objStep = objPackage.Steps("SendMail")
> objConstraint = objStep.PrecedenceConstraints.New("TransformData")
> objConstraint.PrecedenceBasis = DTSStepPrecedenceBasis_ExecResult
> objConstraint.Value = DTSStepExecResult_Failure
> objStep.PrecedenceConstraints.Add(objConstraint)
> End Sub

Is this code part of a CLR-function in SQL2005? The error message "Interface 'DTS.Steps' cannot be indexed because it has no default property." doesn't make sense because VB.NET would not have let you compile the code if DTS.Steps was an interface instead of a collection.

Anyways, you can try this instead:
objStep = objPackage.Steps.Item("TransformData")
If this works, that means in the DTS class you are missing the Default keyword in the Item property declarations.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform