![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I've got a DTS package in SQL, it imports a text file into a table. I'm executing the dts from visual basic.net but the name of the file is inside the package, so I can't change it. Can I pass the name of file as parameter? the code in visual basic is : Dim pkg As DTS.Package pkg = New DTS.Package pkg.LoadFromSQLServer(<server>, <user>, <password>, _ DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, _ "", "", "", <package name>, Nothing) pkg.Execute() pkg.UnInitialize() |
#3
| |||
| |||
|
|
You can. Look at the Connections collection of the package and find your particular connection name/provider. You can then set the DataSource property. -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "fabian" <fabianbg (AT) navegalia (DOT) com> wrote in message news:%230gXPwg8DHA.1356 (AT) tk2msftngp13 (DOT) phx.gbl... Hi, I've got a DTS package in SQL, it imports a text file into a table. I'm executing the dts from visual basic.net but the name of the file is inside the package, so I can't change it. Can I pass the name of file as parameter? the code in visual basic is : Dim pkg As DTS.Package pkg = New DTS.Package pkg.LoadFromSQLServer(<server>, <user>, <password>, _ DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, _ "", "", "", <package name>, Nothing) pkg.Execute() pkg.UnInitialize() |
#4
| |||
| |||
|
|
sorry, can you give me any example. I'm newbee in this area. "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> escribió en el mensaje news:u6mvwzg8DHA.712 (AT) tk2msftngp13 (DOT) phx.gbl... You can. Look at the Connections collection of the package and find your particular connection name/provider. You can then set the DataSource property. -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "fabian" <fabianbg (AT) navegalia (DOT) com> wrote in message news:%230gXPwg8DHA.1356 (AT) tk2msftngp13 (DOT) phx.gbl... Hi, I've got a DTS package in SQL, it imports a text file into a table. I'm executing the dts from visual basic.net but the name of the file is inside the package, so I can't change it. Can I pass the name of file as parameter? the code in visual basic is : Dim pkg As DTS.Package pkg = New DTS.Package pkg.LoadFromSQLServer(<server>, <user>, <password>, _ DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, _ "", "", "", <package name>, Nothing) pkg.Execute() pkg.UnInitialize() |
#5
| |||
| |||
|
|
I've tried with: Dim oconn As DTS.Connection oconn = pkg.Connections() oconn.DataSource = "C:\bcp.txt" oConn = Nothing but it fires an exception : "The specified casting is not valid" "fabian" <fabianbg (AT) navegalia (DOT) com> escribió en el mensaje news:%23hsBjvh8DHA.2576 (AT) TK2MSFTNGP11 (DOT) phx.gbl... sorry, can you give me any example. I'm newbee in this area. "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> escribió en el mensaje news:u6mvwzg8DHA.712 (AT) tk2msftngp13 (DOT) phx.gbl... You can. Look at the Connections collection of the package and find your particular connection name/provider. You can then set the DataSource property. -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "fabian" <fabianbg (AT) navegalia (DOT) com> wrote in message news:%230gXPwg8DHA.1356 (AT) tk2msftngp13 (DOT) phx.gbl... Hi, I've got a DTS package in SQL, it imports a text file into a table. I'm executing the dts from visual basic.net but the name of the file is inside the package, so I can't change it. Can I pass the name of file as parameter? the code in visual basic is : Dim pkg As DTS.Package pkg = New DTS.Package pkg.LoadFromSQLServer(<server>, <user>, <password>, _ DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, _ "", "", "", <package name>, Nothing) pkg.Execute() pkg.UnInitialize() |
![]() |
| Thread Tools | |
| Display Modes | |
| |