June 23, 2004 at 12:25 am
Hi guys,
I created a Package to transfer data from a dBaseIV file to SQL Database table. Is it possible to change the property of the package dynamically, such as changing the name of the dBase file used in the package or the name of the table ? Do you guys have any other options on how to transfer data from dBaseIV file to SQL Table and vice versa ? Thanks ...
June 23, 2004 at 7:34 am
Check out the dynamic properties task in DTS.
BOL
The Dynamic Properties task works by retrieving values from sources outside a Data Transformation Services (DTS) package at package run time and assigning those values to selected package properties. Typically, the external values assigned by the task are unknown until package run time.
The Dynamic Properties task can assign external data or information to a package property from one of the following sources:
June 24, 2004 at 5:30 am
Check out this site. It gives you step by step instructions including screen shots. Helped me out the first time.
http://www.databasejournal.com/features/mssql/article.php/3073161
June 24, 2004 at 7:55 am
First, check out this site: http://www.sqldts.com
Related to your question, I dynamically set the password of my connection object – I'm sure you can change the data source as well…
'**********************************************************************
' ActiveX Script
'**********************************************************************
Function Main()
Dim objPkg
Dim objConnection
' Get reference to the Connection object
Set objPkg = DTSGlobalVariables.Parent
Set objConnection = objPkg.Connections("Other (ODBC Data Source)")
objConnection.Password = DTSGlobalVariables("myPwd").Value
Set objConnection = Nothing
Set objPkg = Nothing
Main = DTSTaskExecResult_Success
End Function
Lastly, from BOL:
The DataSource property specifies a data source name appropriate to the OLE DB provider being used.
Syntax
object.DataSource [= value]
Part | Description |
object | Expression that evaluates to an object in the Applies To list |
value | Data source name |
Data Type
String
Modifiable
Read/write
Prototype (C/C++)
HRESULT GetDataSource(BSTR *pRetVal);
HRESULT SetDataSource(BSTR NewValue);
Remarks
The data source can be a Microsoft® SQL Server™ name, file name, or some other specification meaningful to the provider.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply