VB ActiveX Job Step - Not Executing

  • I have a job step which is an ActiveX type, although the script will execute correctly as a standalone file, when the script is inserted into the Command area of the job step it stalls when you try to execute the job.

    The ActiveX script is using the FileSystemObject to step through the files in a specified folder and if the filename meets a given set of criteria it is using an ADODB.Connection object to add a record to a database table.

    Does anyone know of any reason why an VB ActiveX script should not work in the Job Step when it does work correctly when run from a vbs file?

  • Do you have Function Main() at the start and End Function at the end?

    These are required for ActiveX Scripts in SQL but not for stand-alone VBScripts.

    Hope this helps

    Phill Carter

    --------------------

    Colt 45 - the original point and click interface

    --------------------
    Colt 45 - the original point and click interface

  • Thanks Phill, but using Function Main() stalls the job in the same way as not using Function Main().

  • Do you have any MsgBox or InputBox statements? They won't work when running as a scheduled Job.

    Hope this helps

    Phill Carter

    --------------------

    Colt 45 - the original point and click interface

    --------------------
    Colt 45 - the original point and click interface

  • I suspect that the user account that SQLAgent is running under does not have permission to access the files.

    Alternatively, does the filesystemobject access a network drive? You can't use a mapped drive. And the user must be able to read the drive using the UNC to work.

    Russel Loski, MCSD

    http://www.LoskiDataMovers.com

    Russel Loski

    Russel Loski, MCSE Business Intelligence, Data Platform

  • 1. There are no MsgBox or Input command in the script.

    2. The filepath is a local path and not a network path.

    More importantly, I have now found another way to carry out this task which is successful, so thank you to all that have contributed.

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

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