jdgonzalez
Programmer
I'm really hoping someone can help me out on this one. It's about to drive me NUTS! I have a DTS package that runs everyday. One of the steps is to copy a file locally and move it to a datashare and then changes the name of the file. Here's the wringer. When you open the file on the datashare it's not correct, but when you open that same file locally it is correct. If I delete the datashare file and just execute the active x script on it's own, it will copy and change the file (like it's supposed to do) and display the correct data.
When I say the data is not correct, I mean that it has an old 'snapshot' that it is copying over.
Next step
Any help the community can provide would be greatly appreciated.
When I say the data is not correct, I mean that it has an old 'snapshot' that it is copying over.
Code:
Function Main()
Dim FSO
Set FSO=CreateObject("Scripting.FileSystemObject")
On Error Resume Next
FSO.CopyFile "d:\data\Data\localdata.xls", "\\myserver\"
Main = DTSTaskExecResult_Success
End Function
Code:
Function Main()
Dim FileDate
Dim DateString
Dim FSO
Dim File
FileDate = Date
DateString = DatePart("yyyy",FileDate) & Right("0" & DatePart("m",FileDate), 2) & _
Right("0" & DatePart("d",FileDate), 2)
Set FSO = CreateObject("Scripting.FileSystemObject")
Set File = FSO.GetFile("\\myserver\mydata.xls")
File.Name = "mystring& DateString & ".xls"
Main = DTSTaskExecResult_Success
End Function
Any help the community can provide would be greatly appreciated.