Cross post recommended on this seemingly sinple problem

From: TiredOfSpam (spam_at_drmcl.free-online.co.uk)
Date: 10/08/04


Date: 8 Oct 2004 10:37:39 -0700


"TiredOfSpam" <spam@drmcl.free-online.co.uk> wrote in message
news:403767a1.0410080148.b529ff@posting.google.com...
>I have an ActiveX Script task in a DTS package which executes fine
> within DTS.
> However, if I run it as a sheduled job, it fails with a 'path not
> found error'. I've cut the code down to the approriate problem and
> posted it here, it just makes a simple text file with a name derived
> from the current date and time and puts 'Hello World' in the file
> although in reality I go on to make an xml file. (make sure your path
> exists before you execute it). Why does the scheduled job not execute
> this simple task. I have loads of other jobs that run packages to a
> schedule and the account is a domain account with windows
> administrative rights.
>
> '******************************
> ' Visual Basic ActiveX Script
> '**********************
>
> Const strPath="d:\xml"
>
> Private Function GetDateTime()
> Dim strNow, stryear, strMonth, strDay, strTime
> strNow = Now
> stryear = Mid(strnow, 7, 4)
> strMonth = Mid(strnow, 4, 2)
> strDay = Left(strnow, 2)
> strTime = Replace(Mid(strnow, 12, 8), ":", "")
>
> GetDateTime = stryear + strMonth + strDay + strTime
> End Function
>
> Function Main()
> Dim fso,f,MyFile 'file objects
> Set fso = CreateObject("Scripting.FileSystemObject")
> dim strRightNow
> strRightNow=GetDateTime()
> Set MyFile= fso.CreateTextFile(strPath &"\" & "UPD-"
> & strRightNow & ".txt", True) 'This line fails from a scheduled job
> MyFile.WriteLine("Hello World")
> MyFile.Close
> Main = DTSTaskExecResult_Success
> End Function
>
> 'Error Source= Microsoft VBScript runtime error Error Description:
> Path not found Error on Line 25

Assuming that D: is a local drive (ie. not mapped to a network share), I can
reproduce your error using the code sample, but I have no idea what the
solution is. Usually, this comes down to a problem of ownership and/or
permissions:

http://support.microsoft.com/?kbid=269074

However, even with both the package and the job owned by the same account (I
tried using both sa and a domain admin account in the sysadmin role), and
with the NTFS permissions of the target folder set to allow Everyone to
create a new file, the scheduled job still failed.

You might want to post this in microsoft.public.sqlserver.dts - you may get
a more useful answer there.

Simon



Relevant Pages

  • Re: dts or xp_cmdshell permissions
    ... You could have the users execute the package ... Change the SQL Server or SQL Server Agent Service ... >> Account Without Using SQL Enterprise Manager in SQL Server ...
    (microsoft.public.sqlserver.tools)
  • Re: Yet Another Execution was Canceled by User Problem SOLVED
    ... I've found that if I attempt to execute an execute dts package task ... > disconnected edit window). ...
    (microsoft.public.sqlserver.dts)
  • Re: Executing DTS from Code
    ... Now go to QA and execute the proc. ... Everything works fine on my development workstation which has SQL Server ... I moved the DTS package to the production server and ... runs the DTS package. ...
    (microsoft.public.sqlserver.dts)
  • Re: Security
    ... When you execute the DTS by clicking on the package it is running under ... permissions that defined on your workstation (local account probably), ... > I have a dts package that transfers data from one sql server to another. ...
    (microsoft.public.sqlserver.server)
  • Re: Executin DTSrun Utility under the xp_cmdshell
    ... but the Userid I'm using is the "SA" account with a password. ... I have attahced a complete copy of the output that I get when I execute the ... DTSRun: Package execution complete. ... > context in which the SQL Server service is running. ...
    (microsoft.public.sqlserver.dts)

Quantcast