Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: dts example


Message #1 by Greg Partin <GPartin@c...> on Wed, 28 Nov 2001 14:00:47 -0500
Here is code from the SQL server newsgroup (written by Clifton Dunaway).
hope it helps:

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

Dim 	strSourceServer, strSourceDatabase, strDestinationServer,
strDestinationDatabase


Function Main()

	'retrieve the Global Variables needed

             strSourceServer =3D 
DTSGlobalVariables("SourceServer").Value

             strSourceDatabase =3D
DTSGlobalVariables("SourceDatabase").Value 
             strDestinationServer =3D
DTSGlobalVariables("DestinationServer").Value 
             strDestinationDatabase =3D
DTSGlobalVariables("DestinationDatabase").Value 


	' This routine will load the Source and Destination Server names
and Database names from the Global Variables
	LoadStatements

	Main =3D DTSTaskExecResult_Success
End Function


Private Sub LoadStatements
             set oPkg =3D DTSGlobalVariables.Parent
	set oConn1 =3D oPkg.Connections

	'Load the Source Database Information
	oConn1(1).DataSource =3D strSourceServer
	oConn1(1).Catalog =3D strSourceDatabase

	'Load the Destination Database Information
	oConn1(2).DataSource =3D strDestinationServer
	oConn1(2).Catalog =3D strDestinationDatabase
=09

End Sub

-----Original Message-----
From: Greg Partin [mailto:GPartin@c...]
Sent: Wednesday, November 28, 2001 2:01 PM
To: professional vb
Subject: [pro_vb] dts example


Hi folks,

Does anyone know of any good references of using dts packages and vb
together?  I know with SQL 2000 there is an easy way to execute dts
packages via vb, but i'm running SQL 7.  Microsoft does not seem to be
of any help here.  My main problem is copying a dts package to another
server and executing it using dtsrun from vb (via shell).  I'm using
Windows authentication inside the package and it bombs every time I try
to run it. Does anyone have a better way?

Thank you and much obliged,

Greg

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.303 / Virus Database: 164 - Release Date: 11/24/2001


---
You are currently subscribed to pro_vb as: yehuda@i... To
unsubscribe send a blank email to $subst('Email.Unsub')

Read the future with ebooks at B&N
http://service.bfast.com/bfast/click?bfmid=3D2181&sourceid=3D38934667&cat
ego
ryid=3Drn_ebooks

  Return to Index