Login failed for user '(null)'.

Getting the following error when attempting to access my web app from a
machine other than my local machine (housing the IIS server).

Error Type:

[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'(null)'. Reason: Not associated with a trusted SQL Server connection.
/wfhv/content.asp, line 12

I am connecting to a SQL server that uses trusted security using the
following Connection String (Names changed to protect the innocent):

Provider=sqloledb;Data Source=asdfjkl,1433;Initial Catalog=TstDB;Integrated
Security=SSPI;

The web server is currently on my local machine and after tweaking the
settings I can access without issue locally. However, when another member of
my team attempts to access they get the message shown above. I have verified
that their domain account is set up as a user on the SQL Server. Any ideas?
ShadowVixen [ Di, 05 Juni 2007 14:43 ] [ ID #1730535 ]

Re: Login failed for user '(null)'.

ShadowVixen wrote:
> Getting the following error when attempting to access my web app from
> a machine other than my local machine (housing the IIS server).
>
> Error Type:
>
> [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
> '(null)'. Reason: Not associated with a trusted SQL Server connection.
> /wfhv/content.asp, line 12
>
> I am connecting to a SQL server that uses trusted security using the
> following Connection String (Names changed to protect the innocent):
>
> Provider=sqloledb;Data Source=asdfjkl,1433;Initial
> Catalog=TstDB;Integrated Security=SSPI;
>
> The web server is currently on my local machine and after tweaking the
> settings I can access without issue locally. However, when another
> member of my team attempts to access they get the message shown
> above. I have verified that their domain account is set up as a user
> on the SQL Server. Any ideas?

Verify that your website has Anonymous disabled. Verify by using

Response.Write "The logged in user is """ & _
Request.ServerVariables("LOGON_USER") & """<BR>"

If you don't see the login name of the user, then neither will SQL
Server.

If that's not it, go through the FAQ on SQL Server connections
(http://databases.aspfaq.com/database/what-should-my-connect ion-string-l
ook-like.html) and make sure you've followed all the recommendations.

Then look at the results of this Google search:
http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=gd&q =Login+failed+for+user+%27Null%27&hl=en&rls=GGLD,GGLD:2005-3 7,GGLD:en

If you still have problems, provide more details (SQL Server version and
service pack).

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
reb01501 [ Di, 05 Juni 2007 16:23 ] [ ID #1730536 ]

Re: Login failed for user '(null)'.

The version information follows:

Microsoft SQL Server 2000 - 8.00.2040 (Intel X86) May 13 2005 18:33:17
Copyright (c) 1988-2003 Microsoft Corporation Standard Edition on Windows NT
5.2 (Build 3790: Service Pack 1)

When I changed IIS on my machine to not allow anonymous, I was able to
access it. However, I am finding that others can not and they get the error
mentioned in my first post. They do have access to the SQL Server because
they are using VBA though excel to hit the same database. I am stupmed!

"Bob Barrows [MVP]" wrote:

> ShadowVixen wrote:
> > Getting the following error when attempting to access my web app from
> > a machine other than my local machine (housing the IIS server).
> >
> > Error Type:
> >
> > [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
> > '(null)'. Reason: Not associated with a trusted SQL Server connection.
> > /wfhv/content.asp, line 12
> >
> > I am connecting to a SQL server that uses trusted security using the
> > following Connection String (Names changed to protect the innocent):
> >
> > Provider=sqloledb;Data Source=asdfjkl,1433;Initial
> > Catalog=TstDB;Integrated Security=SSPI;
> >
> > The web server is currently on my local machine and after tweaking the
> > settings I can access without issue locally. However, when another
> > member of my team attempts to access they get the message shown
> > above. I have verified that their domain account is set up as a user
> > on the SQL Server. Any ideas?
>
> Verify that your website has Anonymous disabled. Verify by using
>
> Response.Write "The logged in user is """ & _
> Request.ServerVariables("LOGON_USER") & """<BR>"
>
> If you don't see the login name of the user, then neither will SQL
> Server.
>
> If that's not it, go through the FAQ on SQL Server connections
> (http://databases.aspfaq.com/database/what-should-my-connect ion-string-l
> ook-like.html) and make sure you've followed all the recommendations.
>
> Then look at the results of this Google search:
> http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=gd&q =Login+failed+for+user+%27Null%27&hl=en&rls=GGLD,GGLD:2005-3 7,GGLD:en
>
> If you still have problems, provide more details (SQL Server version and
> service pack).
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
>
ShadowVixen [ Di, 05 Juni 2007 17:23 ] [ ID #1730537 ]

More Information

I changed the Authenticated access to Basic Authntication and it now works
but it is prompting them to enter their domain login information before the
page will load. Since they are already logged in, is it possible to just pass
that info?
ShadowVixen [ Di, 05 Juni 2007 17:40 ] [ ID #1730538 ]

Re: More Information

ShadowVixen wrote:
> I changed the Authenticated access to Basic Authntication and it now
> works but it is prompting them to enter their domain login
> information before the page will load. Since they are already logged
> in, is it possible to just pass that info?

Not with Basic Authentication.
Seriously, without being able to look at your server first-hand, I
haven't a hope of being able to diagnose this problem. Again, go very
carefully through the links I provided, especially these two:
http://support.microsoft.com/default.aspx/kb/307002
http://support.microsoft.com/kb/176379/EN-US/
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
reb01501 [ Di, 05 Juni 2007 18:02 ] [ ID #1730539 ]
Webserver » microsoft.public.inetserver.asp.db » Login failed for user '(null)'.

Vorheriges Thema: Two queries versus one combined query
Nächstes Thema: About update access database data by using ASP