Create an ADO connection to the database and query the table. Like so:
Dim oCon
Dim oRS
Dim sSQL
Dim sDSN
sDSN = "Driver={SQL Server};Server=" & DTSGlobalVariables( "ServerName"
).Value & "; Database=" & DTSGlobalVariables( "DatabaseName" ).Value &
";Trusted_Connection=YES"
Set oCon = CreateObject("ADODB.Connection")
oCon.Open strDSN
sSQL = "Select Field From Table Where X = Y"
Set oRS = oCon.Execute(sSQL)
If Not oRS.EOF And Not oRS.BOF Then
' Set Filename = vlaue of oRS("Field") or oRS(0)
End If
oRS.Close
Set oRS = nothing
oCon.Close
Set oCon = nothing
"Jeff York" wrote:
Quote:
Can someone point me in the right direction for an ActiveX Task. I am not
very profecient in VBScipt.
As a part of the DTS package I want to move a file to a location for
archiving. I want to rename the file with a record from a SQL Table. I know
the syntax for moving the file and renaming it, etc. I just need to know how
to be able to query the table to get the data I need for the rename. Can
I(And how) accomplish this through the Dynamic Properties task. I am
examining it now, but still need a bit of help. Any help, as always, is
appreciated. Thanks! |