Friday, March 9, 2012

dts package active x script

I want to rename my file in the active x script in my DTS package and archive it in a archive folder. My code is archiving the file in the archive, but I need to rename the file too so that it has filename_today's date. I wrote the code like this

set fso = CREATEOBJECT("Scripting.FileSystemObject")

fso.MoveFile DTSGlobalVariables("FileFullName").Value ,DTSGlobalVariables("ArchiveLocation").Value

before this step I want to write

fso.renamefile(DTSGlobalVariables("FileFullName").Value DTSGlobalVariables("FileFullName").Value & now)

and after this step I want to do

fso.MoveFile DTSGlobalVariables("FileFullName").Value ,DTSGlobalVariables("ArchiveLocation").Value

so in the archive folder I can have the date of the file that has been archived.

when i trying to do this

fso.renamefile(DTSGlobalVariables("FileFullName").Value DTSGlobalVariables("FileFullName").Value & now)

I am getting an error
Cannot use parantheses while calling a sub.

Please let me know how can I do this

Off the top of my head, the first thing I would try would be this:
fso.renamefile DTSGlobalVariables("FileFullName").Value DTSGlobalVariables("FileFullName").Value & now
|||I tried this, but now I am getting the error
Object doesn't support this property or method: 'fso.RenameFile'
Please let me know how can I fix this
Any help will be greatly appreciated|||

I figured it out.
Thanks

No comments:

Post a Comment