Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DTS DTSGloabalVariables Save file in variable Finallocation problem


DTS DTSGloabalVariables Save file in variable Finallocation problem

Author
Message
Kecerdikan
Kecerdikan
Forum Newbie
Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)

Group: General Forum Members
Points: 8 Visits: 438
I have made script 1 to generate a file and script 2 to generate the location. The goal is that when the file is created it is moved/saved into the new folder that is created. The problem is I cannot seem to get this to work. I would like to integrate script 2 into script 1 but every attempt so far fails. So can anyone help me out to integrate script 2 for the Finallocation?
(SQL 2000)

Script 1
'**********************************************************************
' Visual Basic ActiveX Script
Function Main()

Dim fileName
fileName = "OnlineBilling_" & DatePart("yyyy", Date) & Right("0" & DatePart("m", Date), 2) & Right("0" & DatePart("d", Date), 2) & "_" & Right("0" & DatePart("h",Now), 2) & Right("0" & DatePart("n",Now), 2) & Right("0" & DatePart("s",Now), 2)
DTSGlobalVariables("FinalLocation").Value = DTSGlobalVariables("NetworkLocation").Value + fileName + ".xls"

Main = DTSTaskExecResult_Success

End Function


Script 2
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Option Explicit

Function Main()

Dim objFSO, dNow, yyyy, mt, dd, hh, nn, ss, NewFolder
Set objFSO = CreateObject("Scripting.FileSystemObject")

dNow = Now
yyyy = Right(Year(dNow), 4)
mt = Right("00" & Month(dNow), 2)
dd = Right("00" & Day(dNow), 2)
hh = Right("00" & Hour(dNow), 2)
nn = Right("00" & Minute(dNow), 2)
ss = Right("00" & Second(dNow), 2)
NewFolder = "E:\Online\" & yyyy & "_" & dd & mt & "_" & hh & nn & ss

'Create the folder
objFSO.CreateFolder NewFolder

Set objFSO= Nothing

Main = DTSTaskExecResult_Success
End Function
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search