Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Executing a DTS Package from a VB Windows Forms App


Executing a DTS Package from a VB Windows Forms App

Author
Message
loki70
loki70
Forum Newbie
Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)

Group: General Forum Members
Points: 8 Visits: 97
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!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search