Modifying the DTS Properties

Modifying the DTS Properties

Post by Zx » Wed, 28 Jul 1999 04:00:00



Can someone send me a sample VB code to do the following.

I have a DTS Package (say Test) which transfers data from a dBase V file
(S1.dbf which has only one table) to a table on my SQL Database (Dev). I
want to be able to pass the source location and the destination database
name to the DTS and execute the DTS.  Note the source location will be
different everytime I run the VB app.

Thanks in advance.

 
 
 

Modifying the DTS Properties

Post by Euan Garde » Sat, 31 Jul 1999 04:00:00


This piece of code shows you how to change properties for a pump, the
principle
is the same for connections.

Function Main()
dim oPackage
dim oPump
 set oPackage = DTSGlobalVariables.Parent
 set oPump = oPackage.Tasks("DTSTask_DTSDataPumpTask_1").CustomTask
 oPump.SourceSQLStatement = "select * from pubs..authors"
 Main = DTSTaskExecResult_Success
End Function


> Can someone send me a sample VB code to do the following.

> I have a DTS Package (say Test) which transfers data from a dBase V file
> (S1.dbf which has only one table) to a table on my SQL Database (Dev). I
> want to be able to pass the source location and the destination database
> name to the DTS and execute the DTS.  Note the source location will be
> different everytime I run the VB app.

> Thanks in advance.


 
 
 

1. DTS - Modifying the Connection.DataSource property.

I have a DTS object.

This DTS object contains an ActiveX script,  2 Connection objects and
a transformation. Text -> SQL. They all depend on successful
executions in steps starting with the ActiveX script.

I need to change the Text Connection object to a new DataSource every
time it is run.

When I run this package the first thing I do is I use
DTSGlobalVariables.parent to get the DTSPackage.Connections(1) object.

This works fine - I can even change the
DTSPackage.Connections(1).DataSource prooperty and It seems to work.
Only problem is my transformation's source table doesin't get updated.

So the package bombs out with the error message: Error opening
datafile: The system cannot find the file specified.

When I open the package, the table name in the transformation
properties is still the old hard-coded text file I needed to enter to
setup the package initially. This changed for the

Connection.Datasource. How can I update the Transformation properties
to use this new DataSource?

thanks in adv.

2. Access - Maximum size of Record

3. Setting Connection property for a Text File (FileName/path) from a Parent DTS to Sub DTS

4. How can I pack a FoxPro 2.5 file ?

5. Modifying properties in VB

6. Too many tables involved in query.

7. Modify existed Column get IDENTITY property ?

8. Primary Keys

9. Modify Custom Task properties at run-time ?

10. Trying to modify a Dynamic Properties Task

11. Unable to modify server properties or maintenance plans

12. Modify table field properties and record values in Access macro

13. Modifying a table field's properties