Re: User not associated with trusted SQL Server connection

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


From: "Richard Waymire [MS]" <rwaymi_ms@microsoft.com>
Date: Tue, 23 Jul 2002 22:55:09 -0700


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".
> >> >>
> >> >> 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 database,
> >> but
> >> >> when I added a new database it appears the database
> is
> >> >> added using Windows 2000 authentication mode and not
> the
> >> >> normal SQL Server login. If I try to change login
> from
> >> the
> >> >> Server Explorer to not use Windows 2000 login I get
> >> >> the "User not associated with trusted SQL Server
> >> >> connection" error.
> >> >>
> >> >> It appears the the Desktop Engine that comes with the
> >> >> development environment, Visual Studio.Net does not
> >> >> provide the SQL Server Enterprise Manager. I am not a
> >> SQL
> >> >> Server expert but I would like to be able to connect
> to
> >> >> the database using sa with blank password. Also how
> to I
> >> >> get a user to be a trusted user.
> >> >>
> >> >> Please help and provide detailed steps keeping in
> mind
> >> >> that I only have the Desktop engine installed from
> >> Visual
> >> >> Stuio.Net. How do I get this to work correctly.
> >> >>
> >> >> Thanks.
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >


Relevant Pages

  • RE: Logging in in background
    ... wold take all kinds of modifictions as I'd need to be checking that each SQL ... my database and all have connection strings associated with them. ... I suspect that there is also an issue on the SQL Server side as I keep ...
    (microsoft.public.access.modulesdaovba)
  • Re: Is it just me or are there BIG problems with SQLCE 3.0?
    ... has been done with parameterised SQL, ... bit of code into my test which closes and reopens the database ... opening and closing the DB connection is not a good idea. ... // Display all error messages ...
    (microsoft.public.sqlserver.ce)
  • Re: Concurrent database access in SQL 2005 Mobile
    ... What version of SQL CE are you using? ... Are you accessing the database from an app written in C++? ... then opens his work forms and it's in those ... It wouldn't seem to me that you'd need a new connection to ...
    (microsoft.public.sqlserver.ce)
  • Re: Perl ODBC complex query example needed
    ... newsgroup about SQL would be better for that. ... I am guessing that you probably want to access an ODBC database ... the connection string will be different). ... > sql connection is in scope for the query. ...
    (comp.lang.perl.misc)
  • Re: User not associated with trusted SQL Server connection
    ... from sysusers" in the database and see what userids already exist.. ... >> using the osql utility. ... >> associated with a trusted SQL Server connection. ... >>>> have trusted access to SQL Desktop version. ...
    (microsoft.public.sqlserver.security)