
September 1st, 2006, 08:12 AM
|
 |
**Wanted Wizard**
|
|
Join Date: Apr 2006
Location: Who knows...
|
|
|
ActiveX Script (VB) for DTS packages
I am not sure what forum this needs to be in: Here or SQL Development, elsewhere?
I am trying to write a DTS package using ActiveX Script. Inside the script, I want to pick up all text files and move them to another directory. The original files are on my webserver and get written there from a FSO from an online application where an enduser submits information.
Currently, my code doesn't like the path: Is there something wrong with code and approach?
Code:
'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
Function Main()
Dim oFSO, oFolder
Dim sSourceFile
Dim sDestinationFile
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder("\\servername\inetpub\wwwroot\www.sheffieldfinancia l.com\")
for each x in oFolder.Files
sSourceFile = "\\servername\inetpub\wwwroot\www.sitename.com\" & x.Name
sDestinationFile = "F:\NEWSCORE\SPOOL\RequestAutoCredit\" & x.Name
oFSO.MoveFile sSourceFile, sDestinationFile
next
' Clean Up
Set oFSO = Nothing
Main = DTSTaskExecResult_Success
End Function
****servername comes from my webserver****sitename is the website****Do I need it mapped differently or am I passing the right commands?
|