First attempt to create DB Script in a DTS...
Goal is to dynamically construct an MDB file (with date/time in file name) which will be the target to an export of 3 lookup tables from SQL Server.
But I get an error on "Set lcSourceFile". Am I missing something?
Any other approaches or suggestions welcomed...
<code>
Function Main()
Set oMyPackage = DTSGlobalVariables.Parent
Dim lcSourceFile
Dim lcTargetFile
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
Set lcSourceFile = "\\server\files\Template.MDB"
Set lcTargetFile = "\\server\files\VVL_2009_xx.MDB"
FSO.CopyFile lcSourceFile, lcTargetFile, True
oMyPackage.Connections("Export_MDB").DataSource = lcTargetFile
Main = DTSTaskExecResult_Success
End Function
</code>
Steve Medvid
IT Consultant & Web Master
Chester County, PA Residents
Please Show Your Support...
Goal is to dynamically construct an MDB file (with date/time in file name) which will be the target to an export of 3 lookup tables from SQL Server.
But I get an error on "Set lcSourceFile". Am I missing something?
Any other approaches or suggestions welcomed...
<code>
Function Main()
Set oMyPackage = DTSGlobalVariables.Parent
Dim lcSourceFile
Dim lcTargetFile
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
Set lcSourceFile = "\\server\files\Template.MDB"
Set lcTargetFile = "\\server\files\VVL_2009_xx.MDB"
FSO.CopyFile lcSourceFile, lcTargetFile, True
oMyPackage.Connections("Export_MDB").DataSource = lcTargetFile
Main = DTSTaskExecResult_Success
End Function
</code>
Steve Medvid
IT Consultant & Web Master
Chester County, PA Residents
Please Show Your Support...