By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,397 Members | 2,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,397 IT Pros & Developers. It's quick & easy.

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

P: n/a
Ok I need some help. Up until Tuesday my application was working fine.
It is an application written in VB. It is very data heavy and
makes multiple calls to a database. The application itself sits on an
IIS6.0 server. And the database is on an SQL2000 server with SP 3a.

On Tuesday we started getting an error when we tried to call up the
application. It said: Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection.

The IIS server settings for the application are set to Windows
Authentication only

The web.config setting are as follows:

<identity impersonate="true" />

<authentication mode="Windows" />

<deny users="?" /> <!-- Allow all users -->

<sessionState mode="InProc"
stateConnectionString="tcpip=" sqlConnectionString="data
source=;Trusted_Connection=yes" cookieless="false"
timeout="20" />

And the connection string is: "data source=myserver;initial
catalog=myDatabase;Integrated Security=true"

I thought I was fine, I thought that I had a trusted connection set up
between the IIS server and the SQl server. Am I missing something here?
I think I have tried almost everything I have read about. Anybody have
any ideas? Thanks for your help.

Dec 9 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a

I had this similar problem in the past.....Is your IIS Server and
Database on the SAME BOX or different?

If its on a different box, does your SQL Server has the WINDOWS ACCOUNT
USER that your IIS Server is CURRENTLY LOG ON AS?

Also, try this:
Configuring IIS to use with TRUSTED_CONNECTION ONLY:
1) Open IIS (Open up Control Panel/Administrative Tools/ Internet
Information Services)
2) In IIS, expand the Local Computer Tree/Web Site/Default Web
3) Once the Default Web Site Tree has been expanded, you will see
a list of all your applications
4) Right Click Internet Information Services on A Specific
Application that you want to configure , select properties, go to the
Directory Secuirty Tab at the top, click on the Edit Button under
Anonymous access and authentication control, make sure that ONLY
Integrated Windows Authentication is Check, and select OK.
5) Close IIS.
6) In your web application, open up the Web.config File
7) Find the following tag in your file: <authentication
mode="Windows" />
8) Add the tag <identity impersonate="true" /> below
<authentication mode="Windows" />
9) Your Web.config should how look like this:
.. . .
<authentication mode="Windows" />
<identity impersonate="true" />
.. . .
You must make sure that SQL Server has the Same Windows User Account
that IIS is under, ie, the same windows user account you use when you
"LOGGED ON" to your OS.

Let me know how it turns out.

Dec 10 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.