Advertisement
Advertisement
| 04.10.2008 at 10:47AM PDT, ID: 23312687 | Points: 500 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: |
Function Main()
Dim objFSO, objFile, objFolder
dim strPath
dim dteTemp,strTemp
dim oPackage
dim oConn
strPath="C:\"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strPath)
dteTemp=cdate("1/31/1900")
For Each objFile in objFolder.Files
if cdate(objFile.DateLastModified) > dteTemp then
dteTemp=objFile.DateLastModified
strTemp=objFile.Name
end if
Next
'msgbox strtemp & dtetemp
set oPackage = DTSGlobalVariables.parent
set oConn = oPackage.connections("Excel")
oConn.datasource = strPath & strTemp
oPackage.steps("DTSStep_DTSDataPumpTask_1").execute
set oPackage = nothing
set oConn = nothing
Set objFolder = Nothing
Set objFSO = Nothing
Main = DTSTaskExecResult_Success
End Function
|