Re: User not associated with trusted SQL Server connection

From: Richard Waymire [MS] (rwaymi_ms@microsoft.com)
Date: 07/25/02


From: "Richard Waymire [MS]" <rwaymi_ms@microsoft.com>
Date: Thu, 25 Jul 2002 09:37:34 -0700


don't know the answer about the ASPNET problem. What this message typically
means is that the SID is already present in the database. Run "select *
from sysusers" in the database and see what userids already exist..

--
Richard Waymire, MCSE, MCDBA
This posting is provided "AS IS" with no warranties, and confers no rights.
"Charles Parker" <cgparker@csi.com> wrote in message
news:12cf01c23349$ffde67b0$35ef2ecf@TKMSFTNGXA11...
Actually when I execute the sp_grantdbaccess command for
the database I want to connect to I get the following
error.
Msg 15063, Level 16, State 1, Server XPSPRO200N\NETSDK,
Procedure sp_grantdbaccess, Line 116
The login already has an account under a different user
name.
I performed a sp_mshasaccess which displays the same login
I was using for db access.
>-----Original Message-----
>right - leave the UID & PWD parameters out and use
the "trusted_connection =
>true" parameter instead and then it should work.
>
>--
>Richard Waymire, MCSE, MCDBA
>
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>"Charles Parker" <cgparker@csi.com> wrote in message
>news:049c01c232b9$afbcf4d0$19ef2ecf@tkmsftngxa01...
>> Richard,
>>
>> I followed the steps you outlined below and they
completed
>> using the osql utility. I then changed the connection
>> string within the application to use the user as
follows:
>>
>> string connectionString = "server=(local)\\NetSDK;
>> uid=Charles Parker; pwd=*******;
database=ASPDotNetBugs";
>>
>> Of course with the password spelled out but I receive
the
>> following error.
>>
>> Login failed for user 'Charles Parker'. Reason: Not
>> associated with a trusted SQL Server connection.
>>
>> Did the osql utility make permanent changes to the
>> database or is it just for that instance.
>>
>>
>> >-----Original Message-----
>> >first connection requires you to be a local admin, when
>> you connect again
>> >run a query
>> >
>> >exec sp_grantlogin [mydomain\myuser]
>> >
>> >then...
>> >
>> >use [mydatabase]
>> >exec sp_adduser [mydomain\myuser]
>> >
>> >
>> >You can do this with osql, log in as osql -
>> Smyserver\myinstance -E
>> >
>> >replace myserver\myinstance with the
>> servername\instancename that were
>> >installed for you to log in, then run each of the
>> commands above followed by
>> >the word go.
>> >
>> >So a run would look like
>> >
>> >c:> osql -Sfred\msde -E
>> >1> exec sp_grantlogin [mydomain\fred]
>> >2> go
>> ><results returned here>
>> >1> use [mydb]
>> >2> go
>> >
>> >etc.
>> >and finally
>> >1> Exit
>> >
>> >to quit osql.
>> >
>> >Hope this helps,
>> >
>> >-Richard
>> >
>> >--
>> >Richard Waymire, MCSE, MCDBA
>> >
>> >This posting is provided "AS IS" with no warranties,
and
>> confers no rights.
>> >"Charles Parker" <cgparker@csi.com> wrote in message
>> >news:0ce201c232aa$69db8b20$2ae2c90a@phx.gbl...
>> >> OK, how do I do that. How do I make a Windows 2000
user
>> >> have trusted access to SQL Desktop version. This is
all
>> >> for development purposes. I just want to be able to
>> >> connect to the SQL Desktop database through code,
but if
>> >> the integrated connection is best how do I set one
up.
>> >>
>> >>
>> >> >-----Original Message-----
>> >> >If you use sa with a blank password you will
probably
>> >> have a virus on your
>> >> >system in a few minutes.  I think you really should
>> >> pursue the integrated
>> >> >connection.
>> >> >
>> >> >--
>> >> >Richard Waymire, MCSE, MCDBA
>> >> >
>> >> >This posting is provided "AS IS" with no warranties,
>> and
>> >> confers no rights.
>> >> >"Charles Parker" <cgparker@csi.com> wrote in message
>> >> >news:049e01c232a3$8c3f4550$3bef2ecf@TKMSFTNGXA10...
>> >> >> I am having a lot of problems and read a lot of
>> >> >> conflicting information about the SQL Server 2000
>> >> Desktop
>> >> >> Engine as installed by Visual Studio.Net. At
first I
>> >> have
>> >> >> trouble connecting to the included Northwind
database
>> >> >> using the usual uid=sa; pwd=; connection string.
It
>> >> always
>> >> >> gave the error "User sa not associated with
trusted
>> SQL
>> >> >> Server connection".
>> >> >{wH$4hO a>
>> >> >> After looking at several web sites and this
>> newsgroup I
>> >> >> discovered I could I did not have to specify a uid
>> and
>> >> pwd
>> >> >> in the connection string by
>> >> using "Trusted_Connection=yes".
>> >> >>
>> >> >> Well this worked for the provided Northwind


Relevant Pages

  • Re: User not associated with trusted SQL Server connection
    ... > using the osql utility. ... > associated with a trusted SQL Server connection. ... > database or is it just for that instance. ...
    (microsoft.public.sqlserver.security)
  • RE: msde local server
    ... If you haven't installed MSDE, ... After you install, it, you can use osql (command-line tool that comes with ... MSDE) to connect to the instance and create a database. ...
    (microsoft.public.sqlserver.msde)
  • Re: OSQL usage
    ... "Piyush" ha scritto nel messaggio ... > Is it possible to create a database at a specified ... > location using OSQL? ... you can download the SQL Server Books On Line at ...
    (microsoft.public.sqlserver.msde)
  • SQL-Server access from a Workstation
    ... The user had MSDE from before with Win NT authenticaton only. ... Then we used OSQL and sp_addlogin. ... we could not access the database from even the server! ... This enabled us to access the database from ...
    (microsoft.public.sqlserver.msde)
  • Re: oSQL - How do I run all .SQL files in a folder by running one batch
    ... The osql can take a /d switch for the database name - but anyway thanks for ... > I would suggest using three part naming and enforcing that as the ...
    (microsoft.public.sqlserver.tools)