ActiveX Permission Denied Copying File

ActiveX Permission Denied Copying File

Post by Jeff Burgoo » Sat, 31 May 2003 07:52:33



I'm using an ActiveX task to copy a remote file (mapped drive ) to my hard
drive.  The package executes properly when run manually from the DTS editor
or when I right click on the package name and click execute.  However, when
I run the task as a job it fails and in the task log file I get the message:

Step Error Source: Microsoft Data Transformation Services (DTS) Package
Step Error Description:Error Code: 0
Error Source= Microsoft VBScrip runtime error
Error Description:  Permission denied.

Error on Line 18

This message refers to the line where I actually copy the file in the
function below.  What is different about scheduling the job that I would not
be able to copy this file and what can I do to fix it?  I assume the job is
being run in a different context with respect to who is being validated to
copy the file.  Here's the function that fails...

' Copy File
Option Explicit

Function Main()

 Dim oFSO
 Dim sSourceFile
 Dim sDestinationFile

 Set oFSO = CreateObject("Scripting.FileSystemObject")

 sSourceFile = "H:\VoIP Accounting active.csv"
 sDestinationFile = "C:\VoIP Accounting active 1.csv"

'THIS NEXT LINE CRAPS OUT!!!
 oFSO.CopyFile sSourceFile, sDestinationFile

 ' Clean Up
 Set oFSO = Nothing

 Main = DTSTaskExecResult_Success
End Function

 
 
 

ActiveX Permission Denied Copying File

Post by Allan Mitchel » Sat, 31 May 2003 16:08:45


Hello, Jeff!

Have a look at this article

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

--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

: Step Error Source: Microsoft Data Transformation Services (DTS) Package
: Step Error Description:Error Code: 0
: Error Source= Microsoft VBScrip runtime error
: Error Description:  Permission denied.

: Error on Line 18

: This message refers to the line where I actually copy the file in the
: function below.  What is different about scheduling the job that I would
not
: be able to copy this file and what can I do to fix it?  I assume the job
is
: being run in a different context with respect to who is being validated to
: copy the file.  Here's the function that fails...

: ' Copy File
: Option Explicit

: Function Main()

:  Dim oFSO
:  Dim sSourceFile
:  Dim sDestinationFile

:  Set oFSO = CreateObject("Scripting.FileSystemObject")

:  sSourceFile = "H:\VoIP Accounting active.csv"
:  sDestinationFile = "C:\VoIP Accounting active 1.csv"

: 'THIS NEXT LINE CRAPS OUT!!!
:  oFSO.CopyFile sSourceFile, sDestinationFile

:  ' Clean Up
:  Set oFSO = Nothing

      ---  Microsoft Outlook Express 6.00.2800.1158

 
 
 

ActiveX Permission Denied Copying File

Post by Allan Mitchel » Sat, 31 May 2003 16:08:45


Hello, Jeff!

Have a look at this article

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

--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

: Step Error Source: Microsoft Data Transformation Services (DTS) Package
: Step Error Description:Error Code: 0
: Error Source= Microsoft VBScrip runtime error
: Error Description:  Permission denied.

: Error on Line 18

: This message refers to the line where I actually copy the file in the
: function below.  What is different about scheduling the job that I would
not
: be able to copy this file and what can I do to fix it?  I assume the job
is
: being run in a different context with respect to who is being validated to
: copy the file.  Here's the function that fails...

: ' Copy File
: Option Explicit

: Function Main()

:  Dim oFSO
:  Dim sSourceFile
:  Dim sDestinationFile

:  Set oFSO = CreateObject("Scripting.FileSystemObject")

:  sSourceFile = "H:\VoIP Accounting active.csv"
:  sDestinationFile = "C:\VoIP Accounting active 1.csv"

: 'THIS NEXT LINE CRAPS OUT!!!
:  oFSO.CopyFile sSourceFile, sDestinationFile

:  ' Clean Up
:  Set oFSO = Nothing

      ---  Microsoft Outlook Express 6.00.2800.1158