Connecting Tech Pros Worldwide Forums | Help | Site Map

Cannot execute DTS package

Peter Afonin
Guest
 
Posts: n/a
#1: Nov 18 '05
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



Hermit Dave
Guest
 
Posts: n/a
#2: Nov 18 '05

re: Cannot execute DTS package


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" <peter@gudzon.net> wrote in message
news:uV0th3omEHA.592@TK2MSFTNGP11.phx.gbl...[color=blue]
> 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[/color]
password,[color=blue]
> I still get similar message:
>
> System.Runtime.InteropServices.COMException (0x80040E4D): Login failed for
> user 'SPECIALTY\pafo'. at DTS._Package.LoadFromSQLServer(String[/color]
ServerName,[color=blue]
> 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
>
>[/color]


Peter Afonin
Guest
 
Posts: n/a
#3: Nov 18 '05

re: Cannot execute DTS package


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" <hermitd.REMOVE@CAPS.AND.DOTS.hotmail.com> wrote in message
news:uDzkzKpmEHA.1844@TK2MSFTNGP12.phx.gbl...[color=blue]
> good old asp.net.
> Whats happening is that it is trying to execute the Query with context of[/color]
NT[color=blue]
> 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
>[/color]
http://msdn.microsoft.com/library/de...SecNetAP05.asp[color=blue]
>
> 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" <peter@gudzon.net> wrote in message
> news:uV0th3omEHA.592@TK2MSFTNGP11.phx.gbl...[color=green]
> > 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[/color][/color]
for[color=blue][color=green]
> > 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[/color]
> password,[color=green]
> > I still get similar message:
> >
> > System.Runtime.InteropServices.COMException (0x80040E4D): Login failed[/color][/color]
for[color=blue][color=green]
> > user 'SPECIALTY\pafo'. at DTS._Package.LoadFromSQLServer(String[/color]
> ServerName,[color=green]
> > 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[/color][/color]
an[color=blue][color=green]
> > error anymore, but the package doesn't execute either.
> >
> > What can I do? I would appreciate your help very much.
> >
> > Thank you,
> >
> >
> > --
> > Peter Afonin
> >
> >[/color]
>
>[/color]


Hermit Dave
Guest
 
Posts: n/a
#4: Nov 18 '05

re: Cannot execute DTS package


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" <peter@gudzon.net> wrote in message
news:e9c1xAqmEHA.1692@TK2MSFTNGP10.phx.gbl...[color=blue]
> 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" <hermitd.REMOVE@CAPS.AND.DOTS.hotmail.com> wrote in message
> news:uDzkzKpmEHA.1844@TK2MSFTNGP12.phx.gbl...[color=green]
> > good old asp.net.
> > Whats happening is that it is trying to execute the Query with context[/color][/color]
of[color=blue]
> NT[color=green]
> > 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
> >[/color]
>[/color]
http://msdn.microsoft.com/library/de...SecNetAP05.asp[color=blue][color=green]
> >
> > 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" <peter@gudzon.net> wrote in message
> > news:uV0th3omEHA.592@TK2MSFTNGP11.phx.gbl...[color=darkred]
> > > 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[/color][/color][/color]
packages[color=blue][color=green][color=darkred]
> > > anymore. I tried all accounts, including thos that have full access[/color][/color][/color]
and[color=blue][color=green][color=darkred]
> > > rights. If I use
> > >
> > > DTSSQLStgFlag_UseTrustedConnection
> > >
> > > I get this error
> > >
> > > System.Runtime.InteropServices.COMException (0x80040E4D): Login failed[/color][/color]
> for[color=green][color=darkred]
> > > user 'NT AUTHORITY\NETWORK SERVICE'. at
> > > DTS._Package.LoadFromSQLServer(String ServerName, String[/color][/color][/color]
ServerUserName,[color=blue][color=green][color=darkred]
> > > 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[/color]
> > password,[color=darkred]
> > > I still get similar message:
> > >
> > > System.Runtime.InteropServices.COMException (0x80040E4D): Login failed[/color][/color]
> for[color=green][color=darkred]
> > > user 'SPECIALTY\pafo'. at DTS._Package.LoadFromSQLServer(String[/color]
> > ServerName,[color=darkred]
> > > String ServerUserName, String ServerPassword, DTSSQLServerStorageFlags
> > > Flags, String PackagePassword, String PackageGuid, String
> > > PackageVersionGuid, String PackageName, Object& pVarPersistStgOfHost)[/color][/color][/color]
at[color=blue][color=green][color=darkred]
> > > MakeXeroxFiles.MakeFiles.btnMake_Click(Object sender, EventArgs e)
> > >
> > > If I add <identity impersonate="true" /> to the Web.config, I don't[/color][/color][/color]
get[color=blue]
> an[color=green][color=darkred]
> > > error anymore, but the package doesn't execute either.
> > >
> > > What can I do? I would appreciate your help very much.
> > >
> > > Thank you,
> > >
> > >
> > > --
> > > Peter Afonin
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


Closed Thread