Results 1 to 2 of 2

Thread: calling a method in activex script

  1. #1
    Ravi Katakam Guest

    calling a method in activex script

    Hi,
    I have a method of a Com component. The method gets the xml string and parses it and populates a table in a database.
    I wanted to call this method as one of the steps of a job. I am trying to use activex script to call that method. The step is running with out populating the table. Can any one help me, here is the code I am using in a job step,

    function myfunction()

    dim cn
    dim rs
    dim strSql
    cn="connection string"
    set obj=server.createobject("myCom.myClass&#34
    set rs=obj.myMethod

    myfunction=DTSTransformStat_OK

    set rs=nothing
    set obj=nothing

    end function


    Thanks in Advace,
    Ravi Katakam.

  2. #2
    Jim W Guest

    calling a method in activex script (reply)

    The code looks ok to me. I run a similar com object to read and download a binary file. The only difference is that my code is appending parens () to the end of the method. It's possible that you need parens like so:

    set rs=obj.myMethod()

    Also, you might not have permission to insert records into the table. I would suggest including error code in the activex object and returning error messages. This would make it easier to discover if something is breaking during runtime.

    Lastly, if you are just populating tables, it might be far easier to open a sql connection and call a stored procedure instead of doing it with an activex control. Obviously you might have a reason for doing it with an activex control instead of a stored procedure, but I've seen few occassions to use a control instead.

    ------------
    Ravi Katakam at 11/6/00 1:02:55 PM

    Hi,
    I have a method of a Com component. The method gets the xml string and parses it and populates a table in a database.
    I wanted to call this method as one of the steps of a job. I am trying to use activex script to call that method. The step is running with out populating the table. Can any one help me, here is the code I am using in a job step,

    function myfunction()

    dim cn
    dim rs
    dim strSql
    cn="connection string"
    set obj=server.createobject("myCom.myClass&#34
    set rs=obj.myMethod

    myfunction=DTSTransformStat_OK

    set rs=nothing
    set obj=nothing

    end function


    Thanks in Advace,
    Ravi Katakam.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •