Reason: Not associated with a trusted SQL Server connection.

Reason: Not associated with a trusted SQL Server connection.

am 15.01.2005 08:13:05 von JohnBeschler

I get the subject message when I try to Open the connectio the database.

Scenario:

IIServer: Win XP
DB Server: Windows server 2003 running SQL Server 2000
Mixed mode is enabled on SQL.

Machines are NOT in domain

Connectio String = "Provider=SQLOLEDB;Data Source=192.168.0.4;User
ID=****;password=********;"

Any IDeas?

NOTE: Using a third party tool I am able to query the databse using
SQLOLEDB.1 driver

Re: Reason: Not associated with a trusted SQL Server connection.

am 15.01.2005 13:56:54 von reb01501

John Beschler wrote:
> I get the subject message when I try to Open the connectio the
> database.
>
> Scenario:
>
> IIServer: Win XP
> DB Server: Windows server 2003 running SQL Server 2000
> Mixed mode is enabled on SQL.
>
> Machines are NOT in domain
>
> Connectio String = "Provider=SQLOLEDB;Data Source=192.168.0.4;User
> ID=****;password=********;"
>
> Any IDeas?
>
> NOTE: Using a third party tool I am able to query the databse using
> SQLOLEDB.1 driver

In ASP, the IUSR account on your server is the user, not you. See the
discussion of your error in this article (make sure you read the KB article
it links to):

http://www.aspfaq.com/show.asp?id=2009

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: Reason: Not associated with a trusted SQL Server connection.

am 15.01.2005 15:11:01 von JohnBeschler

Bob,

I don't think it's a problem with the IUSR account because ASP runs fine.
Unless you are telling me that the system tries to use the IUSR account when
accessing the DB. If that's the case, why? I am specifically telling the
OLEDB driver which user id and password to use to access the DB in the
connection string. If this is the case, can you tell me how to override this
behavior?

The full error message is: Login failed for user 'wink'. Reason: Not
associated with a trusted SQL Server connection. (Sorry I did not post the
full error message to begin with) so that seems to indicate that it is
attempting to connect to the DB with the correct user id.

I did read through the article you pointed me to, but cound not find
anything related to my specific issue.

Thanks,
John






"Bob Barrows [MVP]" wrote:

> John Beschler wrote:
> > I get the subject message when I try to Open the connectio the
> > database.
> >
> > Scenario:
> >
> > IIServer: Win XP
> > DB Server: Windows server 2003 running SQL Server 2000
> > Mixed mode is enabled on SQL.
> >
> > Machines are NOT in domain
> >
> > Connectio String = "Provider=SQLOLEDB;Data Source=192.168.0.4;User
> > ID=****;password=********;"
> >
> > Any IDeas?
> >
> > NOTE: Using a third party tool I am able to query the databse using
> > SQLOLEDB.1 driver
>
> In ASP, the IUSR account on your server is the user, not you. See the
> discussion of your error in this article (make sure you read the KB article
> it links to):
>
> http://www.aspfaq.com/show.asp?id=2009
>
> Bob Barrows
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
>

Re: Reason: Not associated with a trusted SQL Server connection.

am 15.01.2005 16:02:01 von ten.xoc

Are you sure SQL Server is set up to use both SQL Authentication and Windows
authentication?

--
http://www.aspfaq.com/
(Reverse address to reply.)




"John Beschler" wrote in message
news:6973277B-E076-4386-B87D-0CE51569CE0A@microsoft.com...
> Bob,
>
> I don't think it's a problem with the IUSR account because ASP runs fine.
> Unless you are telling me that the system tries to use the IUSR account
when
> accessing the DB. If that's the case, why? I am specifically telling the
> OLEDB driver which user id and password to use to access the DB in the
> connection string. If this is the case, can you tell me how to override
this
> behavior?
>
> The full error message is: Login failed for user 'wink'. Reason: Not
> associated with a trusted SQL Server connection. (Sorry I did not post
the
> full error message to begin with) so that seems to indicate that it is
> attempting to connect to the DB with the correct user id.
>
> I did read through the article you pointed me to, but cound not find
> anything related to my specific issue.
>
> Thanks,
> John
>
>
>
>
>
>
> "Bob Barrows [MVP]" wrote:
>
> > John Beschler wrote:
> > > I get the subject message when I try to Open the connectio the
> > > database.
> > >
> > > Scenario:
> > >
> > > IIServer: Win XP
> > > DB Server: Windows server 2003 running SQL Server 2000
> > > Mixed mode is enabled on SQL.
> > >
> > > Machines are NOT in domain
> > >
> > > Connectio String = "Provider=SQLOLEDB;Data Source=192.168.0.4;User
> > > ID=****;password=********;"
> > >
> > > Any IDeas?
> > >
> > > NOTE: Using a third party tool I am able to query the databse using
> > > SQLOLEDB.1 driver
> >
> > In ASP, the IUSR account on your server is the user, not you. See the
> > discussion of your error in this article (make sure you read the KB
article
> > it links to):
> >
> > http://www.aspfaq.com/show.asp?id=2009
> >
> > Bob Barrows
> > --
> > Microsoft MVP - ASP/ASP.NET
> > Please reply to the newsgroup. This email account is my spam trap so I
> > don't check it very often. If you must reply off-line, then remove the
> > "NO SPAM"
> >
> >
> >

Re: Reason: Not associated with a trusted SQL Server connection.

am 15.01.2005 16:03:39 von reb01501

John Beschler wrote:
> Bob,
>
> I don't think it's a problem with the IUSR account because ASP runs
> fine. Unless you are telling me that the system tries to use the IUSR
> account when accessing the DB.
> If that's the case, why? I am
> specifically telling the OLEDB driver which user id and password to
> use to access the DB in the connection string.

I didn't read your connection string. I based my diagnosis on the error
message you posted, which indicates that the connection is attempting to use
integrated security, not SQL security. Verify that this is the connection
string you are using as opposed to a string containing "SSP1". The "trusted"
word is the indication that integrated security is being used. Oh wait! It
may be because you're connecting to a remote server ...

If this is the case,
> can you tell me how to override this behavior?
>
> The full error message is: Login failed for user 'wink'. Reason: Not
> associated with a trusted SQL Server connection. (Sorry I did not
> post the full error message to begin with) so that seems to indicate
> that it is attempting to connect to the DB with the correct user id.
>

>>>
>>> Connectio String = "Provider=SQLOLEDB;Data Source=192.168.0.4;User
>>> ID=****;password=********;"
>>>
>>> Any IDeas?
>>>

Hmm, you're connecting to an IP ... the connection should default to using
TCP/IP to connect, but try explicitly setting the network library to the
tcp/ip library by adding "Network Library=DBMSSOCN;" to your connection
string.

Also, see:
http://support.microsoft.com/kb/827422
http://support.microsoft.com/?kbid=839569
http://support.microsoft.com/kb/253500/EN-US/

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: Reason: Not associated with a trusted SQL Server connection.

am 15.01.2005 16:55:02 von JohnBeschler

Aaron,

Yes, I've verified this both in Enterprise Manager and in the registry
directly.

This is really frustrating. UI work with ASP and SQL all day at work and do
not have these problems. And we run our SQL server in mixed mode as well,
although we do not allow anonymous connections and we are in an AD domain.

Another note: I wrote a simple VB program that uses the same connection
string and it works, and I can access the DB using George Polouse's Query
Tools for ADO v 4.0 using the exact same credentials I am trying to use in
the ASP page.

Thanks,

"Aaron [SQL Server MVP]" wrote:

> Are you sure SQL Server is set up to use both SQL Authentication and Windows
> authentication?
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
>
>
> "John Beschler" wrote in message
> news:6973277B-E076-4386-B87D-0CE51569CE0A@microsoft.com...
> > Bob,
> >
> > I don't think it's a problem with the IUSR account because ASP runs fine.
> > Unless you are telling me that the system tries to use the IUSR account
> when
> > accessing the DB. If that's the case, why? I am specifically telling the
> > OLEDB driver which user id and password to use to access the DB in the
> > connection string. If this is the case, can you tell me how to override
> this
> > behavior?
> >
> > The full error message is: Login failed for user 'wink'. Reason: Not
> > associated with a trusted SQL Server connection. (Sorry I did not post
> the
> > full error message to begin with) so that seems to indicate that it is
> > attempting to connect to the DB with the correct user id.
> >
> > I did read through the article you pointed me to, but cound not find
> > anything related to my specific issue.
> >
> > Thanks,
> > John
> >
> >
> >
> >
> >
> >
> > "Bob Barrows [MVP]" wrote:
> >
> > > John Beschler wrote:
> > > > I get the subject message when I try to Open the connectio the
> > > > database.
> > > >
> > > > Scenario:
> > > >
> > > > IIServer: Win XP
> > > > DB Server: Windows server 2003 running SQL Server 2000
> > > > Mixed mode is enabled on SQL.
> > > >
> > > > Machines are NOT in domain
> > > >
> > > > Connectio String = "Provider=SQLOLEDB;Data Source=192.168.0.4;User
> > > > ID=****;password=********;"
> > > >
> > > > Any IDeas?
> > > >
> > > > NOTE: Using a third party tool I am able to query the databse using
> > > > SQLOLEDB.1 driver
> > >
> > > In ASP, the IUSR account on your server is the user, not you. See the
> > > discussion of your error in this article (make sure you read the KB
> article
> > > it links to):
> > >
> > > http://www.aspfaq.com/show.asp?id=2009
> > >
> > > Bob Barrows
> > > --
> > > Microsoft MVP - ASP/ASP.NET
> > > Please reply to the newsgroup. This email account is my spam trap so I
> > > don't check it very often. If you must reply off-line, then remove the
> > > "NO SPAM"
> > >
> > >
> > >
>
>
>

Re: Reason: Not associated with a trusted SQL Server connection.

am 15.01.2005 16:59:02 von JohnBeschler

Bob,

I tried adding that parameter to the connection string. When I do, the error
message changes to:
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access
denied.

You mentioned remote server. How do you define this? Both devices are on the
same physical network and same logical network (i.e. same subnet). I use
DHCP for both boxes from my router and I can ping either machine from the
other by computer name and the IP resolves correctly.

As I mentioned to Aaron, this is so frustrating because I work with this at
work everyday and do not experience these issues.


I do appreciate the help from both of you.

"Bob Barrows [MVP]" wrote:

> John Beschler wrote:
> > Bob,
> >
> > I don't think it's a problem with the IUSR account because ASP runs
> > fine. Unless you are telling me that the system tries to use the IUSR
> > account when accessing the DB.
> > If that's the case, why? I am
> > specifically telling the OLEDB driver which user id and password to
> > use to access the DB in the connection string.
>
> I didn't read your connection string. I based my diagnosis on the error
> message you posted, which indicates that the connection is attempting to use
> integrated security, not SQL security. Verify that this is the connection
> string you are using as opposed to a string containing "SSP1". The "trusted"
> word is the indication that integrated security is being used. Oh wait! It
> may be because you're connecting to a remote server ...
>
> If this is the case,
> > can you tell me how to override this behavior?
> >
> > The full error message is: Login failed for user 'wink'. Reason: Not
> > associated with a trusted SQL Server connection. (Sorry I did not
> > post the full error message to begin with) so that seems to indicate
> > that it is attempting to connect to the DB with the correct user id.
> >
>
> >>>
> >>> Connectio String = "Provider=SQLOLEDB;Data Source=192.168.0.4;User
> >>> ID=****;password=********;"
> >>>
> >>> Any IDeas?
> >>>
>
> Hmm, you're connecting to an IP ... the connection should default to using
> TCP/IP to connect, but try explicitly setting the network library to the
> tcp/ip library by adding "Network Library=DBMSSOCN;" to your connection
> string.
>
> Also, see:
> http://support.microsoft.com/kb/827422
> http://support.microsoft.com/?kbid=839569
> http://support.microsoft.com/kb/253500/EN-US/
>
> Bob Barrows
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
>

Re: Reason: Not associated with a trusted SQL Server connection.

am 15.01.2005 17:16:47 von reb01501

John Beschler wrote:
> Bob,
>
> I tried adding that parameter to the connection string. When I do,
> the error message changes to:
> [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
> access denied.

There's another KB article among the ones I posted (the first one, actually)
that deals with this message (Aaron's aspfaq article deals with it as well)

>>
>> Also, see:
>> http://support.microsoft.com/kb/827422
>> http://support.microsoft.com/?kbid=839569
>> http://support.microsoft.com/kb/253500/EN-US/
>>

In addition, see these:

This may be the most relevant:
http://support.microsoft.com/default.aspx?scid=kb;en-us;8840 12


Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: Reason: Not associated with a trusted SQL Server connection.

am 15.01.2005 17:23:59 von ten.xoc

> As I mentioned to Aaron, this is so frustrating because I work with this
at
> work everyday and do not experience these issues.

Are you using the same IP address in both places? Note that 192.168.* is a
private range. If you are connected to the workplace via a VPN, it is
doubtful that right out of the box that IP address means the same thing
(depends on your home network configuration as well as how the VPN is set
up).

Can you connect to that IP, using that username/password (not sa or a
windows account), using Query Analyzer?

Re: Reason: Not associated with a trusted SQL Server connection.

am 15.01.2005 20:15:01 von JohnBeschler

Bob and Aaron,

Are we really dealing with a connectivity issue here? Here's why I ask: I
can access the SQL server using several other tools and applications on the
XP computer. For example, Query Tools (George Polouse) VB 6.0, VBScript, and
MS Excel. The only application that will not access the server is ASP and
ASP runs fine if I try to access a local Access DB (I do not have SQL running
on the XP computer.)

I am downloading SP3a for SQL and I will install that, but again, wouldn't
that affect ANY TCP/IP connections to the SQL server?


I really do appreciate all your help.

PS Aaron: My work network and home network are not related.

"Bob Barrows [MVP]" wrote:

> John Beschler wrote:
> > Bob,
> >
> > I tried adding that parameter to the connection string. When I do,
> > the error message changes to:
> > [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
> > access denied.
>
> There's another KB article among the ones I posted (the first one, actually)
> that deals with this message (Aaron's aspfaq article deals with it as well)
>
> >>
> >> Also, see:
> >> http://support.microsoft.com/kb/827422
> >> http://support.microsoft.com/?kbid=839569
> >> http://support.microsoft.com/kb/253500/EN-US/
> >>
>
> In addition, see these:
>
> This may be the most relevant:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;8840 12
>
>
> Bob Barrows
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
>

Re: Reason: Not associated with a trusted SQL Server connection.

am 15.01.2005 20:33:20 von reb01501

John Beschler wrote:
> Bob and Aaron,
>
> Are we really dealing with a connectivity issue here?

Yes. obviously

> Here's why I
> ask: I can access the SQL server using several other tools and
> applications on the XP computer.

You're using your own user account when you do this. That's why it works.
ASP does not run using your user account.

For example, Query Tools (George
> Polouse) VB 6.0, VBScript, and MS Excel. The only application that
> will not access the server is ASP and ASP runs fine if I try to
> access a local Access DB (I do not have SQL running on the XP
> computer.)

You must have given the local IUSR account file-level access to the folder
containing your database, right? It's all permissions.

>
> I am downloading SP3a for SQL and I will install that, but again,
> wouldn't that affect ANY TCP/IP connections to the SQL server?
>

See the KB article

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: Reason: Not associated with a trusted SQL Server connection.

am 15.01.2005 20:55:04 von JohnBeschler

"Bob Barrows [MVP]" wrote:

> John Beschler wrote:
> > Bob and Aaron,
> >
> > Are we really dealing with a connectivity issue here?
>
> Yes. obviously
>
> > Here's why I
> > ask: I can access the SQL server using several other tools and
> > applications on the XP computer.
>
> You're using your own user account when you do this. That's why it works.
> ASP does not run using your user account.
>

OK, but does that mean ASP uses the IUSR account to access the SQL database?
If so, why the requirement for the User ID and Password in the connection
string? I'm still confused as to why windows is trying to use a trusted
connection when I am using SQL server authentication. What am I missing in
this equation?


> For example, Query Tools (George
> > Polouse) VB 6.0, VBScript, and MS Excel. The only application that
> > will not access the server is ASP and ASP runs fine if I try to
> > access a local Access DB (I do not have SQL running on the XP
> > computer.)
>
> You must have given the local IUSR account file-level access to the folder
> containing your database, right? It's all permissions.

Actually, I have not granted IUSR any permissions anywhere. I'm confused
about this as well, because there is no security tab on the properties page
for any folder on my PC. (I'm used to WIN 2K and not as familiar with XP yet
as I'd like to be.)

I am truly sorry to drag this on so long, but nothing seems to be working
and I am at my wits end.



>
> >
> > I am downloading SP3a for SQL and I will install that, but again,
> > wouldn't that affect ANY TCP/IP connections to the SQL server?
> >
>
> See the KB article
>
> Bob Barrows
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
>

Re: Reason: Not associated with a trusted SQL Server connection.

am 15.01.2005 22:04:58 von reb01501

John Beschler wrote:
> "Bob Barrows [MVP]" wrote:
>
>> John Beschler wrote:
>>> Bob and Aaron,
>>>
>>> Are we really dealing with a connectivity issue here?
>>
>> Yes. obviously
>>
>>> Here's why I
>>> ask: I can access the SQL server using several other tools and
>>> applications on the XP computer.
>>
>> You're using your own user account when you do this. That's why it
>> works. ASP does not run using your user account.
>>
>
> OK, but does that mean ASP uses the IUSR account to access the SQL
> database?

Sort of. The initial "handshake" between the two computers is done under the
IUSR account, which then uses the login and password to log into the sql
server database.

> If so, why the requirement for the User ID and Password in
> the connection string? I'm still confused as to why windows is
> trying to use a trusted connection when I am using SQL server
> authentication. What am I missing in this equation?
>

There are two sets of authentications: Windows, and SQL Server. The user
needs to be accepted by Windows/network before it has access to the box on
which SQL Server is running. Without appropriate credentials on the network,
it won't even see the box on which SS is runnig. Hence, the message "server
does not exist". Once access to the box is gained, then authentication to
gain access to SS begins. If using integrated security, the SS checks to see
if the users Windows/network credentials exist in its list of logins,
allowing the user in if it does. If not, then a user id and login must be
supplied. (This is a high-level view of what takes place - don't hold me too
strongly to this story. It's been a while since I studied it and it's hazy.
But this should be close)

>
>> For example, Query Tools (George
>>> Polouse) VB 6.0, VBScript, and MS Excel. The only application that
>>> will not access the server is ASP and ASP runs fine if I try to
>>> access a local Access DB (I do not have SQL running on the XP
>>> computer.)
>>
>> You must have given the local IUSR account file-level access to the
>> folder containing your database, right? It's all permissions.
>
> Actually, I have not granted IUSR any permissions anywhere. I'm
> confused about this as well, because there is no security tab on the
> properties page for any folder on my PC. (I'm used to WIN 2K and not
> as familiar with XP yet as I'd like to be.)

So you must only have one user at a time using it on your PC. Without
granting file-level permissions to the folder containing the mdb, multi-user
activity is not possible.

If you change your XP security setting to not use Simple Security (i forget
how to do it: you'll have to google for it - i know there's an article about
it at microsoft.com), then you'll get your Security tab back.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: Reason: Not associated with a trusted SQL Server connection.

am 15.01.2005 23:03:01 von JohnBeschler

Thanks to both of you for helping me. Installing SP3a fixed the issue.







"Bob Barrows [MVP]" wrote:

> John Beschler wrote:
> > "Bob Barrows [MVP]" wrote:
> >
> >> John Beschler wrote:
> >>> Bob and Aaron,
> >>>
> >>> Are we really dealing with a connectivity issue here?
> >>
> >> Yes. obviously
> >>
> >>> Here's why I
> >>> ask: I can access the SQL server using several other tools and
> >>> applications on the XP computer.
> >>
> >> You're using your own user account when you do this. That's why it
> >> works. ASP does not run using your user account.
> >>
> >
> > OK, but does that mean ASP uses the IUSR account to access the SQL
> > database?
>
> Sort of. The initial "handshake" between the two computers is done under the
> IUSR account, which then uses the login and password to log into the sql
> server database.
>
> > If so, why the requirement for the User ID and Password in
> > the connection string? I'm still confused as to why windows is
> > trying to use a trusted connection when I am using SQL server
> > authentication. What am I missing in this equation?
> >
>
> There are two sets of authentications: Windows, and SQL Server. The user
> needs to be accepted by Windows/network before it has access to the box on
> which SQL Server is running. Without appropriate credentials on the network,
> it won't even see the box on which SS is runnig. Hence, the message "server
> does not exist". Once access to the box is gained, then authentication to
> gain access to SS begins. If using integrated security, the SS checks to see
> if the users Windows/network credentials exist in its list of logins,
> allowing the user in if it does. If not, then a user id and login must be
> supplied. (This is a high-level view of what takes place - don't hold me too
> strongly to this story. It's been a while since I studied it and it's hazy.
> But this should be close)
>
> >
> >> For example, Query Tools (George
> >>> Polouse) VB 6.0, VBScript, and MS Excel. The only application that
> >>> will not access the server is ASP and ASP runs fine if I try to
> >>> access a local Access DB (I do not have SQL running on the XP
> >>> computer.)
> >>
> >> You must have given the local IUSR account file-level access to the
> >> folder containing your database, right? It's all permissions.
> >
> > Actually, I have not granted IUSR any permissions anywhere. I'm
> > confused about this as well, because there is no security tab on the
> > properties page for any folder on my PC. (I'm used to WIN 2K and not
> > as familiar with XP yet as I'd like to be.)
>
> So you must only have one user at a time using it on your PC. Without
> granting file-level permissions to the folder containing the mdb, multi-user
> activity is not possible.
>
> If you change your XP security setting to not use Simple Security (i forget
> how to do it: you'll have to google for it - i know there's an article about
> it at microsoft.com), then you'll get your Security tab back.
>
> Bob Barrows
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
>