DTS Permission Denied

  • Hi,

    I have a problem in running a DTS. My DTS package has 4 different steps which is at first step I

    have a ActiveXScript running. What it does it is deletes an excel file (testfile.xls) in the server.

    The following steps transforms a data from a DB table and creates an excel file as output.

    Then in Step 4 I have to rename this Excel file also in the server, (using a ActiveXScript and the MOVEFILE sentence) here I got the message

    "Permission denied".

    But when I run it seperatly it runs successfully. 

    I am using the Scripting.FileSystemObject, Excel 2000 and SQL Server 2000.

    Could you give me solution for that.

    Thanks

     

    Cesar Altamirano.

  • Are you using the Windows Scripting Host Scripting.FileSystemObject to achieve this?

    If so, make sure you specify the full path for the file destination, otherwise it won't what directory to put the file in, and would probably default to the current directory.

    Other than that, once you have a file with the Scripting.FileSystemObject.GetFile(filepath) command, you can just set the name property to be the new name and the file will be renamed.

    eg:

    DIM oFSO, oFile

    SET oFSO = CreateObject("Scripting.FileSystemObject")

    SET oFile = oFSO.GetFile('c:\MyDir\MyFile.xls')

    oFile.Name = 'NewFilename.xls'


    Julian Kuiters
    juliankuiters.id.au

  • Hi,

    Yes, 

    I am using the Windows Scripting Host Scripting.FileSystemObject to achieve this.

    I tried the code you send me but,  I got an error message in

    oFile.Name = sFileNameOut

    "Invalid procedure call or argument"

    Where the variable sFileNameOut has the path of the new file.

    Regards,

    Cesar A.

     

      

     

     

     

  • use oFile.Move() with the full path to move the file.

    use oFile.Name = with only the new name (not the path) to rename the file. 


    Julian Kuiters
    juliankuiters.id.au

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

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