Unable to execute ActiveX scripts when logging off | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Unable to execute ActiveX scripts when logging off

Good day,<br /><br />I am accessing or working on my SQL 2000 via the Remote Desktop connection that come with Windows Server 2003. Our network is an Active Directory network. I am able to create and execute ActiveX scripts while I am connected to the SQL server with my profile however, when I log off from the SQL server then my jobs with the ActiveX scripts which I have scheduled to run on the sa account simply do not execute. It all worked well for a few months at some stage and one day it simply stopped working. Could this have happened because we moved from the old windows network to Active driectory or could this be because of some other reason. Anny suggestions would be greatly appreciated [<img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />]
Depends on what the script is doing. When you schedule it on SQL as ‘sa’ it will run with the credentials of the SQL Agent service account. When you login it’s most likely running under administrator credentials. So set up the SQL Agent service account to have the needed credentials. For example write access to a folder for output or access to a network share etc.
Hi Argyle, Thanks for the reply. Yes, I understand what you say and I will make sure that the account has the needed credentials for writing to and from files. I would however like to be a bit more specific about what I am trying to do. I have the below code which I would like to use in order to update two Global Variables however, for some reason the code does not execute and I am unsure how to give credentials to the adminstrator account for this type of job ? ‘**********************************************************************
‘ Visual Basic ActiveX Script
‘************************************************************************ Function Main() Dim MyWeekDay MyWeekDay = Weekday(Date) If MyWeekDay = 2 Then Call Monday ‘MsgBox MyWeekDay Else Call OtherDays ‘MsgBox MyWeekDay End If Main = DTSTaskExecResult_Success
End Function ‘********************************************************Sub Routine*****************************
Function OtherDays DTSGlobalVariables("Startdate").Value = CStr(Date-1)
DTSGlobalVariables("Enddate").Value = CStr(Date) OtherDays = DTSTaskExecResult_Success
End Function ‘********************************************************Sub Routine*****************************
Function Monday DTSGlobalVariables("Startdate").Value = CStr(Date-3)
DTSGlobalVariables("Enddate").Value = CStr(Date) Monday = DTSTaskExecResult_Success
End Function ‘***************************************************************************************************
‘***************************************************************************************************

]]>