Trusted connection doesn't work with SQL server and ASP.Net

P

Peter Afonin

Hello:

I need to execute a DTS package from an ASP.Net application. The SQL server
registration properties are set to "Use Windows authentication".
domain\ASPNET is among the SQL server users.

However, when I use this string to load DTS package:

oPkg.LoadFromSQLServer("WIN2000", , ,
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection, , , ,
"Import_Sales_History")

I get this error:

"System.Runtime.InteropServices.COMException (0x80004005): Login failed for
user '(null)'. Reason: Not associated with a trusted SQL Server connection.
at DTS._Package.LoadFromSQLServer(String ServerName, String
ServerUserName, String ServerPassword, DTSSQLServerStorageFlags Flags,
String PackagePassword, String PackageGuid, String PackageVersionGuid,
String PackageName, Object& pVarPersistStgOfHost)

If I specify UID and password:

oPkg.LoadFromSQLServer("WIN2000", "UID", "password",
DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, , , ,
"Import_Sales_History")

everything works OK.

Why the trusted connection doesn't work in my case, despite that the SQL
server properties are set to use it?

I would appreciate your help.

Thank you,
 
P

Peter Afonin

Thank you.

Yes, I use domain\ASPNET account.

Peter

Kevin Spencer said:
Unless you've set up a Domain ASPNET account, it doesn't exist. The ASPNET
account is a machine-level account.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
The more I learn, the less I know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top