RE: Automating File name in DTS

RE: Automating File name in DTS

 

  

It appears I am missing something here...I guess I am confused about the
line Set cn=oPKG.Connections("Text File(Source)")
and what needs to go there. Is it searching for a file on c:\ or is it
trying to put a file there?
Below is the full Active X Script in the DTS package I am using.


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

Function Main()
Main = DTSTaskExecResult_Success
Dim oPKG
Dim cn
Set oPKG=DTSGlobalVariables.Parent
Set cn=oPKG.Connections("Text File(Source)")
cn.DataSource="C:\"& "P" &vbUseSystemDayOfWeek&"ST"&"AR" &".txt"
End Function

PS If anyone has the time or patience and knows alot about DTS call me at
817-390-7094 to help me out. I am primarily an Oracle DBA that has a few SQL
7 DB to work on, so my knowledge on DTS packages are very limited.

Shawn Smith


> -----Original Message-----
> From: Shawn Smith (William)
> Sent: Thursday, February 21, 2002 11:13 AM
> To: '[Email Address Removed] Subject: Automating File name in DTS
>
> I am trying to have DTS kick out a text file with an automated name of the
> following.
>
> Character(s)
> 1 = P or T (for production or test)
> 2-4 = Day of the Week (MON,TUE,etc.)
> 5-6= ST
> 7-8= AR
>
> I have worked with the script below and it seems to pull the whole Tuesday
> in Day of the week. How do I make it just the first 3 characters of
> vbUseSystemDayOfWeek. And will this Script do what I want it to do in
> naming text file automatically?
>
> '**********************************************************************
> ' Visual Basic ActiveX Script
> '************************************************************************
>
> Function Main()
> Main = DTSTaskExecResult_Success
> Dim oPKG
> Dim cn
> Set oPKG=DTS_Preprint_Burt_CHKSUM.Parent
> Set cn=oPKG.Connections("Text File(Source)")
> cn.DataSource="C:\"& "P" &vbUseSystemDayOfWeek&"ST"&"AR" &".txt"
> End Function
>
> Shawn Smith
> Database Administrator
> Fort Worth Star-Telegram
> 817-390-7094
> 817-291-5240 cell
> 817-667-2757 pager
> [Email Address Removed]
>
MS Sql Server LazyDBA home page