Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2003
    Posts
    6

    Unanswered: activeX component can't create object in DTS running as job

    Following error is displayed when calling/running a vbscript using DTS scheduled as job:
    429: activeX component can't create object

    executing the vbscript works fine
    executing the DTS step calling the vbscript works fine
    executing the DTS package works fine
    executing the DTS package as job (for scheduling reasons) generates the error mentioned above

    has anyone an idee what can be the reason for this behaviour or what to do to solve this problem?

    thanks

  2. #2
    Join Date
    Jan 2003
    Location
    Surrey, UK
    Posts
    23
    One possible cause I have come across is when the MDAC version on the server where the job is being run is earlier than 2.5. If this is the case try updating the MDAC to the latest 2.5 You can download the updates from:

    http://www.microsoft.com/data/download.htm

    I suggest that you download the component checker to determine your currently installed version.
    Last edited by MealinA; 01-20-03 at 07:48.
    Andy


  3. #3
    Join Date
    Jan 2003
    Posts
    6
    I checked the MDAC version, the version 2.62.7926.1 is installed.

    Other idees ??

    Regards

  4. #4
    Join Date
    Dec 2002
    Posts
    1,245

    Re: activeX component can't create object in DTS running as job

    Something(s) to check:

    1. When you say that you execute the DTS task and it works, are you executing the DTS task from Enterprise Manager on a client workstation? If so, you need to understand that the DTS package is using the Sctive Objects that are registered on your client workstation. It means that you need to register these objects on the Server.

    2. Same goes for the VBScript. If you are running it from your client workstation, then it is using the ActiveX objects that are registered on your client workstation.

    3. Same goes for right-clicking on the step in the DTS package designer. If you are doing this from EM on a client workstation, you are using the ActiveX object on your client workstation.

    Only when executed from EM while logged in to the server (either through Terminal Services or at the console) will you actually be using the Server's activeX objects.

    Something else you may have to consider is permissions. When the DTS Pacakge is executed as a job, the user is the SQL Agent service account. If the ActiveX objects have permissions set up on them, you will need to ensure that the SQL Agent service account has the appropriate permissions.

    HTH,

    Hugh Scott

    Originally posted by edwin thaens
    Following error is displayed when calling/running a vbscript using DTS scheduled as job:
    429: activeX component can't create object

    executing the vbscript works fine
    executing the DTS step calling the vbscript works fine
    executing the DTS package works fine
    executing the DTS package as job (for scheduling reasons) generates the error mentioned above

    has anyone an idee what can be the reason for this behaviour or what to do to solve this problem?

    thanks

  5. #5
    Join Date
    Jan 2003
    Posts
    6
    The DTS task, as well as the vbscripts are running on the server, so I think they are using the correct activeX objects.

    About permissions on activeX objects:
    how can I check the permissions (we do not set up special permissions on them, but I'm willing to check it)?
    Also, the SQL Agent service account is the same as the the SQL Server service account. If it is a problem with permission, I think that I should have the same problem when executing the DTS task from Enterprice Manager (unless I'm thinking wrong)?

    Thanks

  6. #6
    Join Date
    Dec 2002
    Posts
    1,245
    You say you can run the DTS package from Enterprise Manager. But are you logged in to the Server, or are you running Emterprise Manager from your client workstation. If you are running EM From your client workstation, then my comments above still apply. DTS can be a bit tricky this way.

    Do this:
    Go to the SQL server console, log in to the server, open EM and run the DTS package. Does it run successfully?

    You can also achieve the same effect by logging in via Terminal Services.

    As for the SQL Agent account being the same as the SQL Service account, that's fine, but it does not necessarily have anything to do with how you are logged in via Enterprise Manager. My SQL Service account is XYZZY, but I use my own Domain account (ABC\HSCOTT) to log in via Enterprise Manager (windows authentication). When I run things (jobs, DTS packages, SQL Scripts, etc.) via Enterprise manager, they are running under my login credentials (not the SQL Service credentials).

    Finally, to verify permissions on your ActiveX objects, you can simply go to the folder where the ActiveX objects are stored. Right-click on the folder and click on the Security tab. Make sure that the SQL Agent account has Read & Execute permissions to that folder.

    Regards,

    Hugh Scott


    Originally posted by edwin thaens
    The DTS task, as well as the vbscripts are running on the server, so I think they are using the correct activeX objects.

    About permissions on activeX objects:
    how can I check the permissions (we do not set up special permissions on them, but I'm willing to check it)?
    Also, the SQL Agent service account is the same as the the SQL Server service account. If it is a problem with permission, I think that I should have the same problem when executing the DTS task from Enterprice Manager (unless I'm thinking wrong)?

    Thanks

  7. #7
    Join Date
    Jan 2003
    Posts
    6
    To answer your question: yes, I was logged on at the server console (in fact as administrator although some people are not happy with that). The accounts for SQL Service as well as for the agent is also administrator. (EM is using windows authentication to connect).
    About the permission for the ActiveX objects, the administrator has all permissions, this seems also to be ok.

    In the meantime, I found something in the microsoft knowledge base:
    article 318819: a DTS package raises exception or stops responding when you run it as a scheduled job.
    I quote: this behavior occurs because the package is using providers, drivers, or DLLs that do not support free threading

    Also, I found some workaround:
    instead of calling the vbscript directly, I run another vbscript that calls that problematic vbscript. In that case I do not get the error anymore.
    (code:
    Set shell = CreateObject("WScript.Shell")
    shell.Run """daily_reports.vbs""",7,False
    )

    Because the problematic vbscript is creating a file, the execution of the next step can be controlled by checking the existence of that file.
    (code:
    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set Factory = CreateObject("ScriptX.Factory")
    Do Until(fso.FileExists("availability_current_month.m dc"))
    Factory.Wait(60000) 'In ms
    Loop
    )

    Of course, if someone has a better solution, I will be happy to hear about it

    Thanks

  8. #8
    Join Date
    Dec 2002
    Posts
    1,245
    First off, thanks for clarifying and posting a solution (though it may be a work-around for now). Secondly, on re-reading my post, I have to apologize if I sounded impatient. I guess I was working on too many things at the time.

    If I understand your work-around correctly, you call the VBScript from the DTS Package. And that works? Whereas when you used an ActiveX object in the DTS package with the same code, it did not? Yikes.

    BTW, thanks for the sample code on running a SHELL command from VBScript. I needed something exactly like that for another project. Hope you don't mind the grand theft!

    Regards,

    Hugh Scott

    Originally posted by edwin thaens
    To answer your question: yes, I was logged on at the server console (in fact as administrator although some people are not happy with that). The accounts for SQL Service as well as for the agent is also administrator. (EM is using windows authentication to connect).
    About the permission for the ActiveX objects, the administrator has all permissions, this seems also to be ok.

    In the meantime, I found something in the microsoft knowledge base:
    article 318819: a DTS package raises exception or stops responding when you run it as a scheduled job.
    I quote: this behavior occurs because the package is using providers, drivers, or DLLs that do not support free threading

    Also, I found some workaround:
    instead of calling the vbscript directly, I run another vbscript that calls that problematic vbscript. In that case I do not get the error anymore.
    (code:
    Set shell = CreateObject("WScript.Shell")
    shell.Run """daily_reports.vbs""",7,False
    )

    Because the problematic vbscript is creating a file, the execution of the next step can be controlled by checking the existence of that file.
    (code:
    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set Factory = CreateObject("ScriptX.Factory")
    Do Until(fso.FileExists("availability_current_month.m dc"))
    Factory.Wait(60000) 'In ms
    Loop
    )

    Of course, if someone has a better solution, I will be happy to hear about it

    Thanks

  9. #9
    Join Date
    Jan 2003
    Posts
    6
    More detailed explanation:
    2 possibilities exist to execute vb scripts:
    1) using an 'activeX script task' object in DTS
    in this case you have the actual vbscript code in the object
    2) using an 'execute process task' object in DTS
    in this case you use 'c:\WINNT\system32\wscript.exe' as Win32 process and the name of the vbscript (e.g. daily_reports.vbs) as parameter

    Both work, but in case of the package is using providers, drivers, or DLLs that do not support free threading, you got for both solution that error.

    The work-around I used is that a created another vbscript (e.g launch_daily_reports.vbs) that calles the original vbscript (e.g. daily_reports.vbs). Code as mentioned.
    Next I used the second method (execute process task) to call the new vbscript (parameter is 'launch_daily_reports.vbs').

    Regards

Posting Permissions

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