SQLDMO Enumerate Dynamic Variable assignments

  • I am creating a web page in ASP.net to show the contents of our DTS scripts.  I am encountering the following error when I try to enumerate the Dynamic variable assignments "Exception Details: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800403FA.".  The offending code snippet is "If oCustTsk.Assignments.Item(j).SourceType = 0 Then" where oCustTsk is an object of type DynamicPropertiesTask and j = 1.

    Any help would be greatly appreciated,

     Bryan Coonfield

    Software Engineer

    City of Richland

  • Is it possible that you only have and item with id 0?

    What did you find out when running this in debug mode?

  • The error occurs on the first time throught the loop when the loop counter ='s 1.  When I check the value of oCustTsk.Assignments.item(0) it throws an error ( oCustTsk.Assignments.item(0) Run-time exception thrown : System.Runtime.InteropServices.COMException - Exception from HRESULT: 0x800403F9.) so I don't think it is a base 0 list.  When I check the value of oCustTsk.Assignments.item(1).sourcetype in the instant window it returns 2 as expected.  When I check the vlaue of oCustTsk.Assignments.item(j).Sourcetype where j = 1 in the instant window it throws a runtime variable.  J is type int16.  It is very confusing to me.  This is a DTS documenting tool I wrote in ASP/Vbscript a couple of years ago and am trying to convert.

     

    TIA

    Bryan

  • Have you tried rewriting it as

    For each Task in ...

    next

    ??

  • That did the trick.

     

    Thank You Remi! 

    Bryan

  • Np... have the same problem in Access, when one syntax fails, try another .

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply