PJames
2009-07-13 19:16:13 UTC
Hi,
I have an ActiveX task in my DTS (SQL 2000) which just goes and gets a
file from a network server and puts it on a network drive. Nothing
fancy. No checking for connections or validating the file arrives.
Works fine when I run it manually, either just this step or the entire
DTS package. When I put it on schedule, the DTS actually seems to work
except that the resulting file in the destination directory is 0
bytes. The file gets created on the target, so it doesn't seem like a
writing permissions issue. Any thoughts? Here is the part of the
DTS that puts the file. (By the way, I am not using the FTP task that
comes with SQL Server due to the bug in 2000 which corrupts the DTS
package if it is moved to a different server. Our separation of
duties do not allow me to put the package into production or for the
DBA to modify DTS packages..)
'*******************************************************************************************
' This script uses FTP to move a file from the transfers directory
for processing
''*******************************************************************************************
Function Main()
Dim oFso, oShell, srcPth, txtFile
srcPth = "\\xxx-xxx\someplace\corp\"
Set oFso = CreateObject("Scripting.FileSystemObject")
Set txtFile = oFso.CreateTextFile( srcPth & "ftpSend.scr", True)
'Write the Header
txtFile.writeline( "open xxx-yyy-zzz" )
txtFile.writeline( "useridhere" )
txtFile.writeline( "passwordhere" )
txtFile.writeline( "get thisfile.csv "\\xxx-xxx\someplace\corp
\" )
txtFile.writeline( "bye")
txtFile.Close
Set oShell = CreateObject("WScript.Shell")
oShell.Run "ftp.exe -i -s:\\xxx-xxx\someplace\corp\ftpSend.scr"
=========================
I have also tried creating a bat file which has the FTP in it and
running that at the oShell.Run line, but the result is the same.
Any ideas?
Thanks
I have an ActiveX task in my DTS (SQL 2000) which just goes and gets a
file from a network server and puts it on a network drive. Nothing
fancy. No checking for connections or validating the file arrives.
Works fine when I run it manually, either just this step or the entire
DTS package. When I put it on schedule, the DTS actually seems to work
except that the resulting file in the destination directory is 0
bytes. The file gets created on the target, so it doesn't seem like a
writing permissions issue. Any thoughts? Here is the part of the
DTS that puts the file. (By the way, I am not using the FTP task that
comes with SQL Server due to the bug in 2000 which corrupts the DTS
package if it is moved to a different server. Our separation of
duties do not allow me to put the package into production or for the
DBA to modify DTS packages..)
'*******************************************************************************************
' This script uses FTP to move a file from the transfers directory
for processing
''*******************************************************************************************
Function Main()
Dim oFso, oShell, srcPth, txtFile
srcPth = "\\xxx-xxx\someplace\corp\"
Set oFso = CreateObject("Scripting.FileSystemObject")
Set txtFile = oFso.CreateTextFile( srcPth & "ftpSend.scr", True)
'Write the Header
txtFile.writeline( "open xxx-yyy-zzz" )
txtFile.writeline( "useridhere" )
txtFile.writeline( "passwordhere" )
txtFile.writeline( "get thisfile.csv "\\xxx-xxx\someplace\corp
\" )
txtFile.writeline( "bye")
txtFile.Close
Set oShell = CreateObject("WScript.Shell")
oShell.Run "ftp.exe -i -s:\\xxx-xxx\someplace\corp\ftpSend.scr"
=========================
I have also tried creating a bat file which has the FTP in it and
running that at the oShell.Run line, but the result is the same.
Any ideas?
Thanks