Friday, March 9, 2012

Newbie Can't connect - Trusted Server issue.

Hello,
I'm creating an application that will rely on a central SQL Server database
for its help file. I'm a beginner with SQL Server really, and I keep
getting the following error;
"Login failed for use 'whateverUser'. Reason: Not associated with a trusted
SQL Server connection"
I can't seem to find a solution in the help files. Any direction would be
greatly appreciated.
Thanks!Jozef (SPAM_O_NATOR@.telus.net) writes:
> I'm creating an application that will rely on a central SQL Server
> database for its help file. I'm a beginner with SQL Server really, and
> I keep getting the following error;
> "Login failed for use 'whateverUser'. Reason: Not associated with a
> trusted SQL Server connection"
> I can't seem to find a solution in the help files. Any direction would be
> greatly appreciated.
You can log into SQL Server in two ways: Windows authentication, and
SQL Server authentication. The former is always available, for SQL Server
authentication to be available, the server must be enabled for this,
which by default it is not.
With Windows authentication, SQL Server accepts your Windows user,
if it has been granted access to SQL Server, and if SQL Server can
somehow validate it. With SQL Server authentication, you provide a
username and password that SQL Server itself validates.
Windows authentication is generally more secure, and also more convient,
since it does not require any extra username/password. However, it does
not always work well, if user and server are not in the same domain -
including when there is no domain at all.
Since you replaced the actual username with 'whateverUser', I don't know
which form of authentication you are trying to use. But if you are not
using Windows authentication, I recommend that you switch to this, by
replacing UserID and Password in the connection string with
Trusted_connection=Yes.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||You also might want to verify the connection string you are using is
completely correct. http://www.connectionstrings.com has a good collection
of all the various formats to use.
If you're just getting started in programming, you also might want to check
out www.asp.net and www.devx.com. They have some great articles and samples
to get you started, in addition to books, etc.
MeanOldDBA
derrickleggett@.hotmail.com
http://weblogs.sqlteam.com/derrickl
When life gives you a lemon, fire the DBA.
"Erland Sommarskog" wrote:

> Jozef (SPAM_O_NATOR@.telus.net) writes:
> You can log into SQL Server in two ways: Windows authentication, and
> SQL Server authentication. The former is always available, for SQL Server
> authentication to be available, the server must be enabled for this,
> which by default it is not.
> With Windows authentication, SQL Server accepts your Windows user,
> if it has been granted access to SQL Server, and if SQL Server can
> somehow validate it. With SQL Server authentication, you provide a
> username and password that SQL Server itself validates.
> Windows authentication is generally more secure, and also more convient,
> since it does not require any extra username/password. However, it does
> not always work well, if user and server are not in the same domain -
> including when there is no domain at all.
> Since you replaced the actual username with 'whateverUser', I don't know
> which form of authentication you are trying to use. But if you are not
> using Windows authentication, I recommend that you switch to this, by
> replacing UserID and Password in the connection string with
> Trusted_connection=Yes.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp
>|||Thanks Erland, that's the most definitive answer I've been able to find.
I'd like to use Windows authentication if I can but this has given me enough
info to be able to play with both.
Thanks again!
"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns9679C13AF3F52Yazorman@.127.0.0.1...
> Jozef (SPAM_O_NATOR@.telus.net) writes:
> You can log into SQL Server in two ways: Windows authentication, and
> SQL Server authentication. The former is always available, for SQL Server
> authentication to be available, the server must be enabled for this,
> which by default it is not.
> With Windows authentication, SQL Server accepts your Windows user,
> if it has been granted access to SQL Server, and if SQL Server can
> somehow validate it. With SQL Server authentication, you provide a
> username and password that SQL Server itself validates.
> Windows authentication is generally more secure, and also more convient,
> since it does not require any extra username/password. However, it does
> not always work well, if user and server are not in the same domain -
> including when there is no domain at all.
> Since you replaced the actual username with 'whateverUser', I don't know
> which form of authentication you are trying to use. But if you are not
> using Windows authentication, I recommend that you switch to this, by
> replacing UserID and Password in the connection string with
> Trusted_connection=Yes.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp

No comments:

Post a Comment