Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Cannot execute DTS package

Reply
Thread Tools

Cannot execute DTS package

 
 
Peter Afonin
Guest
Posts: n/a
 
      09-14-2004
Hello,

Our SQL server used to run under System account, and I had no problems
executing DTS packages from the ASP.NET:

Dim oPkg As DTS.Package
oPkg = CreateObject("DTS.Package")
oPkg.LoadFromSQLServer("WIN2000", , ,
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrus tedConnection, , , ,
"Import DPCK")
oPkg.Execute()
oPkg.UnInitialize()
oPkg = Nothing

Then we switched to the different account, and I cannot execute packages
anymore. I tried all accounts, including thos that have full access and
rights. If I use

DTSSQLStgFlag_UseTrustedConnection

I get this error

System.Runtime.InteropServices.COMException (0x80040E4D): Login failed for
user 'NT AUTHORITY\NETWORK SERVICE'. at
DTS._Package.LoadFromSQLServer(String ServerName, String ServerUserName,
String ServerPassword, DTSSQLServerStorageFlags Flags, String
PackagePassword, String PackageGuid, String PackageVersionGuid, String
PackageName, Object& pVarPersistStgOfHost) at
MakeXeroxFiles.MakeFiles.btnMake_Click(Object sender, EventArgs e)

If I use the flag DTSSQLStgFlag_Default and specify user name and password,
I still get similar message:

System.Runtime.InteropServices.COMException (0x80040E4D): Login failed for
user 'SPECIALTY\pafo'. at DTS._Package.LoadFromSQLServer(String ServerName,
String ServerUserName, String ServerPassword, DTSSQLServerStorageFlags
Flags, String PackagePassword, String PackageGuid, String
PackageVersionGuid, String PackageName, Object& pVarPersistStgOfHost) at
MakeXeroxFiles.MakeFiles.btnMake_Click(Object sender, EventArgs e)

If I add <identity impersonate="true" /> to the Web.config, I don't get an
error anymore, but the package doesn't execute either.

What can I do? I would appreciate your help very much.

Thank you,


--
Peter Afonin


 
Reply With Quote
 
 
 
 
Hermit Dave
Guest
Posts: n/a
 
      09-14-2004
good old asp.net.
Whats happening is that it is trying to execute the Query with context of NT
AUTHORITY\NETWORK SERVICE
since you are using trusted connection.

so either set up the above user to access SQL & the database.
or just use impersonate identity tag to impersonate a fixed user.

matrix detailing the execution context with asp.net
http://msdn.microsoft.com/library/de...SecNetAP05.asp

code project article which has snippet to allow aspnet account (worker
process in 2003 runs under Network Server) to the database
http://www.codeproject.com/cs/databa..._in_csharp.asp

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Peter Afonin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> Our SQL server used to run under System account, and I had no problems
> executing DTS packages from the ASP.NET:
>
> Dim oPkg As DTS.Package
> oPkg = CreateObject("DTS.Package")
> oPkg.LoadFromSQLServer("WIN2000", , ,
> DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrus tedConnection, , , ,
> "Import DPCK")
> oPkg.Execute()
> oPkg.UnInitialize()
> oPkg = Nothing
>
> Then we switched to the different account, and I cannot execute packages
> anymore. I tried all accounts, including thos that have full access and
> rights. If I use
>
> DTSSQLStgFlag_UseTrustedConnection
>
> I get this error
>
> System.Runtime.InteropServices.COMException (0x80040E4D): Login failed for
> user 'NT AUTHORITY\NETWORK SERVICE'. at
> DTS._Package.LoadFromSQLServer(String ServerName, String ServerUserName,
> String ServerPassword, DTSSQLServerStorageFlags Flags, String
> PackagePassword, String PackageGuid, String PackageVersionGuid, String
> PackageName, Object& pVarPersistStgOfHost) at
> MakeXeroxFiles.MakeFiles.btnMake_Click(Object sender, EventArgs e)
>
> If I use the flag DTSSQLStgFlag_Default and specify user name and

password,
> I still get similar message:
>
> System.Runtime.InteropServices.COMException (0x80040E4D): Login failed for
> user 'SPECIALTY\pafo'. at DTS._Package.LoadFromSQLServer(String

ServerName,
> String ServerUserName, String ServerPassword, DTSSQLServerStorageFlags
> Flags, String PackagePassword, String PackageGuid, String
> PackageVersionGuid, String PackageName, Object& pVarPersistStgOfHost) at
> MakeXeroxFiles.MakeFiles.btnMake_Click(Object sender, EventArgs e)
>
> If I add <identity impersonate="true" /> to the Web.config, I don't get an
> error anymore, but the package doesn't execute either.
>
> What can I do? I would appreciate your help very much.
>
> Thank you,
>
>
> --
> Peter Afonin
>
>



 
Reply With Quote
 
 
 
 
Peter Afonin
Guest
Posts: n/a
 
      09-14-2004
Thank you very much, Hermit, it worked.

The problem was that when I tried to add 'NT AUTHORITY\NETWORK SERVICE'
manually in Enterprise Mgr - I couldn't find it (I don't understand why),
but when I ran
EXEC sp_grantlogin 'NT AUTHORITY\NETWORK SERVICE' - it worked.

Peter

"Hermit Dave" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> good old asp.net.
> Whats happening is that it is trying to execute the Query with context of

NT
> AUTHORITY\NETWORK SERVICE
> since you are using trusted connection.
>
> so either set up the above user to access SQL & the database.
> or just use impersonate identity tag to impersonate a fixed user.
>
> matrix detailing the execution context with asp.net
>

http://msdn.microsoft.com/library/de...SecNetAP05.asp
>
> code project article which has snippet to allow aspnet account (worker
> process in 2003 runs under Network Server) to the database
> http://www.codeproject.com/cs/databa..._in_csharp.asp
>
> --
>
> Regards,
>
> Hermit Dave
> (http://hdave.blogspot.com)
> "Peter Afonin" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello,
> >
> > Our SQL server used to run under System account, and I had no problems
> > executing DTS packages from the ASP.NET:
> >
> > Dim oPkg As DTS.Package
> > oPkg = CreateObject("DTS.Package")
> > oPkg.LoadFromSQLServer("WIN2000", , ,
> > DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrus tedConnection, , , ,
> > "Import DPCK")
> > oPkg.Execute()
> > oPkg.UnInitialize()
> > oPkg = Nothing
> >
> > Then we switched to the different account, and I cannot execute packages
> > anymore. I tried all accounts, including thos that have full access and
> > rights. If I use
> >
> > DTSSQLStgFlag_UseTrustedConnection
> >
> > I get this error
> >
> > System.Runtime.InteropServices.COMException (0x80040E4D): Login failed

for
> > user 'NT AUTHORITY\NETWORK SERVICE'. at
> > DTS._Package.LoadFromSQLServer(String ServerName, String ServerUserName,
> > String ServerPassword, DTSSQLServerStorageFlags Flags, String
> > PackagePassword, String PackageGuid, String PackageVersionGuid, String
> > PackageName, Object& pVarPersistStgOfHost) at
> > MakeXeroxFiles.MakeFiles.btnMake_Click(Object sender, EventArgs e)
> >
> > If I use the flag DTSSQLStgFlag_Default and specify user name and

> password,
> > I still get similar message:
> >
> > System.Runtime.InteropServices.COMException (0x80040E4D): Login failed

for
> > user 'SPECIALTY\pafo'. at DTS._Package.LoadFromSQLServer(String

> ServerName,
> > String ServerUserName, String ServerPassword, DTSSQLServerStorageFlags
> > Flags, String PackagePassword, String PackageGuid, String
> > PackageVersionGuid, String PackageName, Object& pVarPersistStgOfHost) at
> > MakeXeroxFiles.MakeFiles.btnMake_Click(Object sender, EventArgs e)
> >
> > If I add <identity impersonate="true" /> to the Web.config, I don't get

an
> > error anymore, but the package doesn't execute either.
> >
> > What can I do? I would appreciate your help very much.
> >
> > Thank you,
> >
> >
> > --
> > Peter Afonin
> >
> >

>
>



 
Reply With Quote
 
Hermit Dave
Guest
Posts: n/a
 
      09-14-2004
yeah i tried it through enterprise manager as well and finally i went the
query analyser way to execute the stored procs

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Peter Afonin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thank you very much, Hermit, it worked.
>
> The problem was that when I tried to add 'NT AUTHORITY\NETWORK SERVICE'
> manually in Enterprise Mgr - I couldn't find it (I don't understand why),
> but when I ran
> EXEC sp_grantlogin 'NT AUTHORITY\NETWORK SERVICE' - it worked.
>
> Peter
>
> "Hermit Dave" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > good old asp.net.
> > Whats happening is that it is trying to execute the Query with context

of
> NT
> > AUTHORITY\NETWORK SERVICE
> > since you are using trusted connection.
> >
> > so either set up the above user to access SQL & the database.
> > or just use impersonate identity tag to impersonate a fixed user.
> >
> > matrix detailing the execution context with asp.net
> >

>

http://msdn.microsoft.com/library/de...SecNetAP05.asp
> >
> > code project article which has snippet to allow aspnet account (worker
> > process in 2003 runs under Network Server) to the database
> > http://www.codeproject.com/cs/databa..._in_csharp.asp
> >
> > --
> >
> > Regards,
> >
> > Hermit Dave
> > (http://hdave.blogspot.com)
> > "Peter Afonin" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Hello,
> > >
> > > Our SQL server used to run under System account, and I had no problems
> > > executing DTS packages from the ASP.NET:
> > >
> > > Dim oPkg As DTS.Package
> > > oPkg = CreateObject("DTS.Package")
> > > oPkg.LoadFromSQLServer("WIN2000", , ,
> > > DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrus tedConnection, , , ,
> > > "Import DPCK")
> > > oPkg.Execute()
> > > oPkg.UnInitialize()
> > > oPkg = Nothing
> > >
> > > Then we switched to the different account, and I cannot execute

packages
> > > anymore. I tried all accounts, including thos that have full access

and
> > > rights. If I use
> > >
> > > DTSSQLStgFlag_UseTrustedConnection
> > >
> > > I get this error
> > >
> > > System.Runtime.InteropServices.COMException (0x80040E4D): Login failed

> for
> > > user 'NT AUTHORITY\NETWORK SERVICE'. at
> > > DTS._Package.LoadFromSQLServer(String ServerName, String

ServerUserName,
> > > String ServerPassword, DTSSQLServerStorageFlags Flags, String
> > > PackagePassword, String PackageGuid, String PackageVersionGuid, String
> > > PackageName, Object& pVarPersistStgOfHost) at
> > > MakeXeroxFiles.MakeFiles.btnMake_Click(Object sender, EventArgs e)
> > >
> > > If I use the flag DTSSQLStgFlag_Default and specify user name and

> > password,
> > > I still get similar message:
> > >
> > > System.Runtime.InteropServices.COMException (0x80040E4D): Login failed

> for
> > > user 'SPECIALTY\pafo'. at DTS._Package.LoadFromSQLServer(String

> > ServerName,
> > > String ServerUserName, String ServerPassword, DTSSQLServerStorageFlags
> > > Flags, String PackagePassword, String PackageGuid, String
> > > PackageVersionGuid, String PackageName, Object& pVarPersistStgOfHost)

at
> > > MakeXeroxFiles.MakeFiles.btnMake_Click(Object sender, EventArgs e)
> > >
> > > If I add <identity impersonate="true" /> to the Web.config, I don't

get
> an
> > > error anymore, but the package doesn't execute either.
> > >
> > > What can I do? I would appreciate your help very much.
> > >
> > > Thank you,
> > >
> > >
> > > --
> > > Peter Afonin
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
call, run or execute a DTS package from an APS (aspx) page? kevin bailey ASP .Net 5 11-19-2004 09:37 PM
Cannot execute DTS package Peter Afonin ASP .Net 3 09-14-2004 09:31 PM
Re: URGENT!!!!!!!!!!!!!!!!Can Triggers fire to execute DTS Package????????? bruce barker ASP .Net 1 04-02-2004 08:56 PM
Is there a way to allow aspnet_wp.exe to execute a DTS Package that can be executed from a Windows Form application? Dean R. Henderson ASP .Net 1 11-13-2003 05:52 PM
Cannot execute DTS package from ASP.Net Peter Afonin ASP .Net 0 08-29-2003 06:41 PM



Advertisments