dbTalk Databases Forums  

Executing a DTS Package from a VB Windows Forms App

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


Discuss Executing a DTS Package from a VB Windows Forms App in the microsoft.public.sqlserver.dts forum.



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

Default Executing a DTS Package from a VB Windows Forms App - 06-27-2008 , 08:26 AM






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 "Loggin" 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!

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.