![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a DTS package that I created using the DTS Wizard. I've tested it and it works. Now I want to execute that package from a VB.Net program. I downloaded the code example from the MSDN Website and am trying to follow it - so far with no success. My code looks like this... Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim dtsp As New DTS.Package dtsp.LoadFromSQLServer( _ ServerName:="STEVE", _ ServerUserName:="Stephen", _ ServerPassword:="mypassword", _ PackageName:="myPackage") dtsp.Execute() End Sub When I click the button, I get an error message that says that... An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in DTS.exe Additional information: Login failed for user 'Stephen'. Reason: Not associated with a trusted SQL Server connection. SQL Server is set up to use the "Windows" security mode. User "Stephen" is valid in both Windows and in SQL Server. Stephen is a member of the "Administrators" group in windows. In SQL Server "STEVE/Stephen" ("STEVE" is the name of my local database) is in the System Administrators role. When I go to the Enterprise Manager (after logging on to Windows as "Stephen") I get straight in. It sure looks to me like "Stephen" has a trusted connection. Any ideas? BBM |
#3
| |||
| |||
|
|
have you read Gert's article? (Don't foget you will still need the DTS dlls) http://www.sqldev.net/dts/DotNETCookBook.htm -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - You thought DTS was good. here we show you the new stuff. www.konesans.com - Consultancy from the people who know "BBM" <bbm (AT) bbmcompany (DOT) com> wrote in message news:21A3F368-DD48-45AC-AA26-790A45FD5B19 (AT) microsoft (DOT) com... I have a DTS package that I created using the DTS Wizard. I've tested it and it works. Now I want to execute that package from a VB.Net program. I downloaded the code example from the MSDN Website and am trying to follow it - so far with no success. My code looks like this... Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim dtsp As New DTS.Package dtsp.LoadFromSQLServer( _ ServerName:="STEVE", _ ServerUserName:="Stephen", _ ServerPassword:="mypassword", _ PackageName:="myPackage") dtsp.Execute() End Sub When I click the button, I get an error message that says that... An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in DTS.exe Additional information: Login failed for user 'Stephen'. Reason: Not associated with a trusted SQL Server connection. SQL Server is set up to use the "Windows" security mode. User "Stephen" is valid in both Windows and in SQL Server. Stephen is a member of the "Administrators" group in windows. In SQL Server "STEVE/Stephen" ("STEVE" is the name of my local database) is in the System Administrators role. When I go to the Enterprise Manager (after logging on to Windows as "Stephen") I get straight in. It sure looks to me like "Stephen" has a trusted connection. Any ideas? BBM |
#4
| |||
| |||
|
|
I didn't have to do the the all the "runtime callable wrapper" stuff that was listed on Gert's site. I looked at the date on that stuff, and it must have pre-dated VS 2003. All I did was add a reference to the COM object Microsoft DTS Object Library to my project and it seemed to work. |
![]() |
| Thread Tools | |
| Display Modes | |
| |