![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Sub : Execute a DTS package from VB - Error in Dynamically Changing Text file path ------------------------------------------------------------------------ ---------- 'Executing a DTS package from Visual Basic code.Works fine but if i am trying to change textfile path then its giving error "Connection "textFile" was not found". I am using Sql 7 and Sql 2000 server as backend Wt could be the reason ? Need help urgentely ------------------------------------------------------------------------ ---------- Private Sub SimpleExecutePackage() Dim oPKG As New DTS.Package oPKG.LoadFromSQLServer "MyServer", , , _ DTSSQLStgFlag_UseDefaultConnection, , , , "MyPackage" ' Set Filename Set oConn = oPKG.Connections("TextFile") ------- error on this line oConn.DataSource = txtFilename.Text Set oConn = Nothing oPKG.Execute oPKG.UnInitialize Set oPKG = Nothing End Sub ------------------------------------------------------------------------ ---------- -- Posted via http://dbforums.com |
![]() |
| Thread Tools | |
| Display Modes | |
| |