• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 903
  • Last Modified:

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

OK I'm getting the message:

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

I'm using windows authentication, how do I add this user so I can connect to the SQL DB from a different machine using this login.
0
propractice
Asked:
propractice
  • 8
  • 6
  • 3
  • +2
1 Solution
 
sigmaconCommented:
The administrative account on one windows machine is another then the administrative account on another machine unless you are in a domain. You need to run with whatever you trying to connect as a user that is configured to connect on the other server. How are you connecting? What is your client app?
0
 
pique_techCommented:
My guess is that you're logged in to your workstation with its local Administrator logon.

If that is your intent, then you need to add the appropriate Windows group to the SQL server permissions.  It would probably be a Windows group called YourWorkstationName\Administrators.  If your intent is JUST to grant the Administrator logon rights, then add the single windows logon YourWorkstationName\Administrator to the SQL server.

If that is not your intent, then you need to log on to your workstation with a network ID that has rights on the SQL server, either itself or through group membership.
0
 
propracticeAuthor Commented:
I'm using a connection string for asp.net
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
pique_techCommented:
Does your asp.net application run under the administrator account?  You might want to be sure that's what you need.

Anyway, I'd suggest that you might want to configure a different account that has appropriately restricted rights on the SQL server and use it, with SQL Server security, to log your asp.net app into the database.
0
 
RichardCorbettCommented:
When using trusted connections make sure that the user account(s) from the alternate machine(s) that you are remotely connecting from has access (permissions) to the objects that you are accessing.  Just add them, adjust the permissions in SQL according to the functions that they will be performing (datareader only for selects, datawriter for updates/inserts, etc.)...  Hope this helps.
0
 
propracticeAuthor Commented:
Well I made a new account called SQL_user on the SQL Server and added that as a user that had access to the database propractice.  But when i tried it from a different machine (tried running the code) it did not work.
0
 
pique_techCommented:
Now you have to configure your asp connection to use SQL authentication and provide it with the name and password.
0
 
RichardCorbettCommented:
I remember there being an .ini file where in which you can supply the credentials.  I believe this was within the IIS framework directory.
0
 
propracticeAuthor Commented:
Well I even tried just setting up a DSN then just using that, but it didn't work either :(

At one point I could just connect to it using enterprise manager that I installed on my laptop w/o a username/password?
0
 
sigmaconCommented:
Can you connect to the server with enterprise manager with the SQL_user you just created? If so, post the connection code you are using in your application, so we can debug it.
0
 
propracticeAuthor Commented:
OK I get this error, (I just created a new user named propractice and I gave it access to the propractice adatabase)

Exception Details: System.Data.OleDb.OleDbException: Login failed for user 'propractice'. Reason: Not associated with a trusted SQL Server connection.

This is my connection string
:
"Provider=sqloledb;Data Source=TAPEBACKUP;Initial Catalog=propractice;User Id=propractice;Password=blah"
0
 
ShogunWadeCommented:
You have probably not got Mixed Mode security enabled in SQL.
0
 
propracticeAuthor Commented:
How do I enable that?
0
 
ShogunWadeCommented:
right click the server in enterprise manager and click the security tab . you need to set it to Mixed (Sql + Windows authentication)
0
 
propracticeAuthor Commented:
OK i tried that, still the same problem, I think perhaps it's interpreting the user as IUSR_machinename since i'm executing it from asp.. ?

But it doesn't make sense b/c it's the connection string
0
 
ShogunWadeCommented:
Are you using the SQLClient stuff in asp.net?
0
 
ShogunWadeCommented:
can you give ous the snippet of code that is making the connection?
0
 
propracticeAuthor Commented:
I've tried both of these strings:

        ConnString = "Provider=sqloledb;" & _
                    "Data Source=TAPEBACKUP;" & _
                    "Initial Catalog=propractice;" & _
                    "User Id=propractice;" & _
                    "Password=sdfg"

        ConnString = "Data Source=TAPEBACKUP;" & _
                    "Database=propractice;Trusted_Connection=true;"

        Dim sqlConn As System.Data.SqlClient.SqlConnection
        Dim SqlCommand As System.Data.SqlClient.SqlCommand
        sqlConn = New System.Data.SqlClient.SqlConnection(ConnString)
        SqlCommand = New System.Data.SqlClient.SqlCommand(strSQL, sqlConn)

        sqlConn.Open()
0
 
ShogunWadeCommented:
looks ok to me.

? can you log into query analyser with these credentials ?
0
 
propracticeAuthor Commented:
dunno didn't try....  I think it might have something to do with the fact that I'm on another machine?
0
 
ShogunWadeCommented:
try login in to query analyser and let me know if that works
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 8
  • 6
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now