dbTalk Databases Forums  

DTS VB ActiveX Script + Executing Job Step'1 (abcd)'

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS VB ActiveX Script + Executing Job Step'1 (abcd)' in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Moi
 
Posts: n/a

Default DTS VB ActiveX Script + Executing Job Step'1 (abcd)' - 06-11-2004 , 06:04 AM






I have define it in to a package names "abcd". It will check the existed
of folder and file. If those of them does not existed, it will recreat.
This package I have set the schedule time to be run in every minute. I
got success in running this package manually but when I remove all the files
and folder that I have just created by running this package manually. I got
nothing and I have seen in Job, the column status "Executing Job Step'1
(abcd)' ". This message still appear without ending.

Could any one tell me how could I solve this problem?



The following code is the script that I have writen to create folder and
the file.

'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************

Function Main()
dim filename, commandfilename
dim foldername, folderreceive


filename = DTSGlobalVariables("TransferCommandFileName").valu e
foldername = DTSGlobalVariables("TransferFolder").value
commandfilename = foldername &"\"&filename
folderreceive = foldername &"\"&
DTSGlobalVariables("ReceiveFolder").value

set oFSO = CreateObject("Scripting.FileSystemObject")

If Not oFSO.FolderExists(foldername) Then
oFSO.CreateFolder(foldername)
End if

If Not oFSO.FolderExists(folderreceive) Then
oFSO.CreateFolder(folderreceive)
End if

If NOT oFSO.FileExists(commandfilename) Then
set oFile = oFSO.OpenTextFile(commandfilename , 2, 1)
oFile.writeline ("open " & DTSGlobalVariables("TransferServer"))
oFile.writeline DTSGlobalVariables("TransferLogin")
oFile.writeline DTSGlobalVariables("TransferPassword")
oFile.writeline "get " &
DTSGlobalVariables("TransferFileSourceName").Value &" "& folderreceive &"\"&
DTSGlobalVariables("TransferFileDestinationName"). Value
oFile.writeline "quit"
oFile.Close
set oFile = nothing
End If

set oFSO = nothing

Main = DTSTaskExecResult_Success
End Function




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.