i ahve the follwoing activeX script for copying a text file using global variables for the path and file names.
This worked perfectly yesterday when i wrote it, i've come in today and when i try to run it i get a "function not found error". can anyone see what is going on?
Cheers, Craig
Si fractum non sit, noli id reficere
Code:
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Option Explicit
Function Main()
Dim oFSO
Dim sSourceFile
Dim sDestinationFile
Set oFSO = CreateObject("Scripting.FileSystemObject")
sSourceFile = QualifyPath(DTSGlobalVariables("SourceFilePath").Value) & DTSGlobalVariables("SourceFileName").Value &".txt"
sDestinationFile = QualifyPath(DTSGlobalVariables("DestinationFilePath").value) & DTSGlobalVariables("SourceFileName").value & "_" & replace(Date -1,"/","") & ".txt"
oFSO.CopyFile sSourceFile, sDestinationFile
' Clean Up
Set oFSO = Nothing
Main = DTSTaskExecResult_Success
End Function
Function QualifyPath(ByVal sPath)
If Right(sPath, 1) = "\" Then
QualifyPath = sPath
Else
QualifyPath = sPath & "\"
End If
End Function
Cheers, Craig
Si fractum non sit, noli id reficere