Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

"Login failed for user ''. The user is not associated with a trusted SQL Server connection." How do I fix this issue?....

Posted on 2007-03-28
7
Medium Priority
?
7,311 Views
Last Modified: 2013-11-24
At work I have a Windows logon account called username 'bullwinkle' and a password called 'moose'

The IT dept has set up a new machine for me so I can setup IIS with a virtual server to an application I wrote that collects data. The application works 100% fine on my development machine. On the new machine it works great up until the point at the end where I have to connect to the SQL db for writing the data.... then I get the following error:

      "Login failed for user ''. The user is not associated with a trusted SQL Server connection."

***I would like to emphasize the fact that:

1) there is no username that shows up in the error... only an empty set of commas ' '
2) SQL server is already set to 'mixed' mode

The IT SQL Server guy gave me the user name and password that allow writing and reading from the SQL database for the application I wrote. The username and password he gave me for this is username 'batman' and the password is called 'robin'. However, there is no account on the new machine for 'batman' to logon with.... only my 'bullwinkle' user account will allow me to logon.

I told the IT guy that the new machine needed an account setup for 'batman' and the pasword setup to 'robin' .... this will allow me to use the Windows logon account of 'batman' and password 'robin'. Having IIS set to use Windows logon will then fall back on this 'batman' account----which is the same account and password that is set up with permission to access the SQL Server dbase.

At the moment, the error occurs when I am logged in with my 'bullwinkle' account----but the SQL Server permission to write-read from the database is only authorized for the 'batman' account---which doesn't exist on the new machine.

Am I correct about insisting there has to be a 'batman' account in order to have an existing Windows logon account that will also have permission to write-read to the SQL Server?

Help. ..... many thanks.

0
Comment
Question by:jazjef
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 13

Expert Comment

by:Wizilling
ID: 18812924
current user logged into the computer/pc/server doesnt have access to the sql databse.
get an adminstrator to give accesss to database.
0
 
LVL 13

Expert Comment

by:Wizilling
ID: 18812956
ignore my first comment.
1) i think the connection string used trucsted connection. you might need to change it in the application so that it uses the choosen user/password.
>>>batman' account in order to have an existing Windows logon
2) if u use a windows authenication (i hope that what is what u meant) then not neccsary to setup a sql authentication account eg batman.
again u need to check the application code for the connection string to see how it connects to the database.

check sql server logs and event viewer failed logins. then u will know what failed for whom. If that information is not there then u need to select (tick) this option in sql server properties.
0
 
LVL 4

Author Comment

by:jazjef
ID: 18813085
Wizilling:

here is my connection string as it is in the application....

        Dim conPACBEW As New SqlConnection
        Dim sConnectionString As String _
        = "Data Source=ABSQL;" _
        & "Initial Catalog=ABINCOMES;" _
        & "Integrated Security=SSPI"
        conPACBEW.ConnectionString = sConnectionString
        Return conPACBEW

Does this connection string info give you any additional insight or suggestions?

That's a great idea about having them look at the logs... that will give me more specific info.....


0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 18813132
Since you are using anonymous login, your best bet is to use SQL Server authentication instead of Windows Authentication.
0
 
LVL 13

Accepted Solution

by:
Wizilling earned 2000 total points
ID: 18813186
try if this helps

        Dim sConnectionString As String _
        = "Data Source=ABSQL;" _
        & "Initial Catalog=ABINCOMES;" _
        & "UserId=Batman;Password=Robin"

and later if the above works u will have to learn to encrypt the connection string.
0
 
LVL 4

Author Comment

by:jazjef
ID: 18819683
thanks a ton Wizilling! Your solution worked perfectly right off the bat....
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 18820227
You are welcome.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question