dbTalk Databases Forums  

assigning source file at runtime

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


Discuss assigning source file at runtime in the microsoft.public.sqlserver.dts forum.



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

Default assigning source file at runtime - 12-06-2006 , 03:54 AM






hi,

i have made a package in SQL SERVER 2000 and then execute it from
vb.net

the source file is .txt file and the destination is sql table.
now the source file's path is to be given at runtime thru vb.net code.

i used the following code:




Dim dtsImport1 As New DTS.Package2

Dim stp1 As DTS.Step

With dtsImport1

.LoadFromSQLServer("servername", "", "",
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrus tedConnection, , , ,
"insert_pkg")

.Connections.Item(1).DataSource = "C:\" +textbox1.text+
"\filename.txt"

.FailOnError = True
.Execute()
End With




but it is giving error that package execution failed.....copy step
failed...



plzzzzzz can any1 tell me wats wrong with this code and how should i
assign filepath at runtime while i have already given a path to
connection1 when making the package..


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.