November 4, 2003 at 10:07 am
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?
November 4, 2003 at 3:39 pm
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
November 5, 2003 at 2:04 am
Thanks Phill, but using Function Main() stalls the job in the same way as not using Function Main().
November 5, 2003 at 2:36 pm
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
November 5, 2003 at 8:15 pm
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
November 6, 2003 at 1:56 am
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