Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Executing a DTS Package from a VB Windows Forms App Expand / Collapse
Author
Message
Posted Wednesday, July 2, 2008 7:14 AM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, December 15, 2014 2:41 PM
Points: 4, Visits: 75
I have a Windows Form application (not an ASP.NET app) where I would
like to execute a DTS package on my local SQL server instance. The
code looks like this:

Dim objDTSPackage As New DTS.Package

objDTSPackage.LoadFromSQLServer("(local)", "USERNAME", "PASSWORD",
DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, "", "", "", "Import
Shuttle Inventory", "")

objDTSPackage.Execute()

I know that my server and package name are correct, because if I
switch to "DTSSQLStgFlag_UseTrustedConnection", the package executes
correctly. When I attempt to run the code above, it get the error
"Login failed for user 'USERNAME'. Reason: Not associated with a
trusted SQL Server connection.". For discussion purposes, I am
showing generic UN & PW values, but am 100% sure that I am using the
correct credentials for a login on my server.


Following someone else's post, I went to the package's properties and
on the "Login" tab selected "Log package execution to SQL server".
Once this was checked, I entered my user's credentials under the "SQL
Server Authenticaion" section. When I click "OK", I get the same
error message as my code - so at least things are consistent.

I know there have been other posts about this issue in regards to
ASP.NET pages attempting to do this. The solutions I saw there
involved using the ASP.NET account to get things working - which I
would rather not do here, even if I could.

I would greatly appreciate any comments or suggestions. Thank you!
Post #527288
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse