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.
propracticeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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?
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.
propracticeAuthor Commented:
I'm using a connection string for asp.net
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

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.
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.
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.
pique_techCommented:
Now you have to configure your asp connection to use SQL authentication and provide it with the name and password.
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.
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?
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.
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"
ShogunWadeCommented:
You have probably not got Mixed Mode security enabled in SQL.
propracticeAuthor Commented:
How do I enable that?
ShogunWadeCommented:
right click the server in enterprise manager and click the security tab . you need to set it to Mixed (Sql + Windows authentication)
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
ShogunWadeCommented:
Are you using the SQLClient stuff in asp.net?
ShogunWadeCommented:
can you give ous the snippet of code that is making the connection?
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()
ShogunWadeCommented:
looks ok to me.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.