Re: User not associated with trusted SQL Server connection

From: Charles Parker (cgparker@csi.com)
Date: 07/24/02


From: "Charles Parker" <cgparker@csi.com>
Date: Wed, 24 Jul 2002 12:19:00 -0700


Richard,

OK, I removed the uid and pwd from the connect string and
used Trusted_Connection=yes which is now the same for the
connection that worked for the Northwind example which
already existed. However, for the newly created database I
get the following error.

Cannot open database requested in login 'ASPDotNetBugs'.
Login fails. Login failed for user 'XPSPRO200N\ASPNET'.

I do not understand why it works for the Northwind
database but it for some reason thinks the user is ASPNET
for the new database.

Charles...

>-----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".
>> >> >{wcDĶ >
>> >> >> 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: Changing Connection String programmatically
    ... Connection strings of different years can be stored in app.config ... is declared in MyDataset.Designer.cs as private, ... every year we will create new database. ... If you are storing connnection string information related to additional ...
    (microsoft.public.sqlserver.connect)
  • Send Form results to database error
    ... ' Send results to the database. ... ' myConnString = Connection string to database. ... ' myConnection = The database connection object. ...
    (microsoft.public.access.forms)
  • Re: User count
    ... Dim colUsers as New Collection ... Dim sCompName as string ... or back it up, or something, then take a look at the use of the "Connection ... Create a table in the front-end database, ...
    (microsoft.public.access.formscoding)
  • Re: [VW 7.3.1] ODBCConnection
    ... I played around with a few combinations on the connection string and ... with a trusted SQL Server connection. ... there are differences for database connects. ... > any database specific odbc drivers. ...
    (comp.lang.smalltalk)
  • Re: Installer - Custom Textboxes in UI problem
    ... > void Install function. ... I've tested it by writing the string out to a text ... > intended, a ADO.Net Connection String. ... > throw new InstallException("The database conection information is not ...
    (microsoft.public.dotnet.languages.csharp)