471,310 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,310 software developers and data experts.

Error accessing SQL Server:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.

I guess I get this because, my pages are hosted on WinXP IIS and the sql
server is on Win2k3.

So my aspnet a/c doesn't match with the Win2k3's aspnet a/c.

But what is the solution for this?

Thanks


Nov 19 '05 #1
2 1321
Well, let me explain how SQL Server handles security first, so the next time
this issue comes up in some different fashion, you will know how to deal
with it.

SQL Server has 2 security modes: SQL Server only, and Mixed SQL Server and
Windows authentication. that is, SQL Server has its own built-in
authentication system, but it can also integrate with the local machine or
Active Directory to use Windows authentication. SQL Server's authentication
model is very similar to Windows, in that it has users and groups, and
specific levels of permissions. When SQL Server uses SQL Server
authentication, the Connection String must contain the user name and
password for that user to authenticate. In Windows authentication this is
not necessary, as the user's Windows credentials are passed in the message
itself. When using Windows authentication, the user that is requesting
access to the SQL Server must be a domain user account in Active Directory
(or the local machine, if the machine is not part of a domain), and that
account must be explicitly granted SQL Server parmissions.

Your error message indicates that you are using Windows authentication, in
which case, the user account under which your ASP.Net application is running
is not registered with SQL Server as a trusted account. Knowing that, your
solution is obvious.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"news.microsoft.com" <v-*****@microsoft.com> wrote in message
news:eT****************@TK2MSFTNGP14.phx.gbl...
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.

I guess I get this because, my pages are hosted on WinXP IIS and the sql
server is on Win2k3.

So my aspnet a/c doesn't match with the Win2k3's aspnet a/c.

But what is the solution for this?

Thanks

Nov 19 '05 #2
Excellent info!

Thanks Kevin

I fixed it by creating a new login and using that.

I did not know how to give the asp.net a/c which is local on my machine,
access on sql server, as it can only read and understand AD accounts.

My webpages are hosted on another machine than the sql server, thus the
difference.

Thanks.

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Well, let me explain how SQL Server handles security first, so the next
time this issue comes up in some different fashion, you will know how to
deal with it.

SQL Server has 2 security modes: SQL Server only, and Mixed SQL Server and
Windows authentication. that is, SQL Server has its own built-in
authentication system, but it can also integrate with the local machine or
Active Directory to use Windows authentication. SQL Server's
authentication model is very similar to Windows, in that it has users and
groups, and specific levels of permissions. When SQL Server uses SQL
Server authentication, the Connection String must contain the user name
and password for that user to authenticate. In Windows authentication this
is not necessary, as the user's Windows credentials are passed in the
message itself. When using Windows authentication, the user that is
requesting access to the SQL Server must be a domain user account in
Active Directory (or the local machine, if the machine is not part of a
domain), and that account must be explicitly granted SQL Server
parmissions.

Your error message indicates that you are using Windows authentication, in
which case, the user account under which your ASP.Net application is
running is not registered with SQL Server as a trusted account. Knowing
that, your solution is obvious.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Ambiguity has a certain quality to it.

"news.microsoft.com" <v-*****@microsoft.com> wrote in message
news:eT****************@TK2MSFTNGP14.phx.gbl...
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.

I guess I get this because, my pages are hosted on WinXP IIS and the sql
server is on Win2k3.

So my aspnet a/c doesn't match with the Win2k3's aspnet a/c.

But what is the solution for this?

Thanks


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by AdamM | last post: by
13 posts views Thread by JebBushell | last post: by
13 posts views Thread by Praveen_db2 | last post: by
2 posts views Thread by le0 | last post: by
3 posts views Thread by =?Utf-8?B?bWNpbWFnaW5n?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.