Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DTS.Steps default Value
Message
De
23/03/2006 13:04:27
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01107050
Message ID:
01107070
Vues:
20
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform