Problem Copying file using ActiveX Task

  • Hi There,

     

    I have an activeX task which I'm trying to use to copy an .bcp text file from one share to antoher directory.

    The script is as follows:

    '**********************************************************************

    '  Visual Basic ActiveX Script

    '************************************************************************

    Function Main()

    Dim FSO,SourceShare,WorkingDir

    Set FSO=CreateObject("Scripting.FileSystemObject")

    SourceShare = DTSGlobalVariables("strNewProducts").Value

    WorkingDir = DTSGlobalVariables("strWorkingDir").Value

    FSO.CopyFile  SourceShare, WorkingDir

    Main = DTSTaskExecResult_Success

    End Function

    However, when I try to run it I get the following error:

    VB Runtime error

    Permission Denied.

    I've tried checking the shares involved and making sure the agent's account has full permissions without any joy.

    Can anyone else suggest what the problem might be.

     

    Cheers,

     

    Jay.

     

  • Jay,

    Do both the SourceShare and WorkingDir contain a fully qualified path and filename?

  • Are you running the package under a domain account?  If you are crossing server boundaries you can't run the package under the local admin account.

  • Yep Ron, that was the problem.

    Thanks for your help.

    Jay.

  • You're welcome.

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

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