dbTalk Databases Forums  

Amend DTS Package with VB

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Amend DTS Package with VB in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kristen Hodges
 
Posts: n/a

Default Amend DTS Package with VB - 02-05-2004 , 10:17 PM






I've got a server on which I need to update the connection
on all the DTS packages.

I can connect and get a list of the packages but I'm stuck
on getting each package. On the
step "myPkg.LoadFromSQLServer ServerName = "WNCHASQ02DE",
DTSSQLStgFlag_UseTrustedConnection, PackageName = pkgname
"
I receive an error that "Access is Denied or the Server
does not exist"... which is obviously odd because I've
already proven I can connect to the server when I
retrieved all the packages in the enumpackageinfos step.
I've tried using both trusted and SQL connections but it's
the same either way.

I'm at a loss! If anyone has any ideas I'd love to hear
them!

Code is below.

Set oDTSApp = New DTS.Application
Set oGetPkg = oDTSApp.GetPackageSQLServer
("WNCHASQ02DE", "", "", 256)
Set cPkgs = oGetPkg.EnumPackageInfos("",
True, "") 'EnumPackageInfos
(PackageName,ReturnLatest,PackageID )
For Each oPkg In cPkgs
pkgname = oPkg.Name
Set myPkg = New DTS.Package
'myPkg.LoadFromSQLServer "WNCHASQ02DE", "DTSUser", "DTS
User", DTSSQLStgFlag_Default, "", "", "", pkgname
myPkg.LoadFromSQLServer ServerName = "WNCHASQ02DE",
DTSSQLStgFlag_UseTrustedConnection, PackageName = pkgname
Set cConns = myPkg.Connections
For Each oConn In cConns
If oConn.ConnectionProperties("Data Source")
= "WNCHASQ02" Then
oConn.ConnectionProperties("Data Source")
= "(local)"
Debug.Print myPkg.Name & ": " & oConn.Name
End If
Next
Next oPkg

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.