Re: Cannot connect using sa



Basically, that's because there isn't generally an advantage to SQL Server
authentication. Windows authentication is significantly more secure. There
are some application architectures that requires SQL Server authentication
but in general, if you can avoid using it, your application will be more
secure.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"ralph" <vralphv@xxxxxxxxxxxxx> wrote in message
news:dor98s.2uk.1@xxxxxxxxxxxxxxxxxxxxx
>
> "Sue Hoegemeier" <Sue_H@xxxxxxxxxxxxx> wrote in message
> news:lpg2r19641gd306h3jjt9874cahge32u6b@xxxxxxxxxx
>> Make sure you have it configured to allow both SQL Server
>> and Windows authentication. Looks like it might be set to
>> Windows authentication only.
>
> I found an article in MSDN telling how to change authentication
> in SQL Server Management Studio. I don't have that.
> I removed the password and user from the connection string.
> Now it is working. Funny it didn't work to remove it yesterday.
> Still not sure what the advantage of SQL Server authentication is.
> Thanks.
>
> Ralph
>
>> -Sue
>>
>> On Mon, 26 Dec 2005 16:56:05 -0700, "ralph"
>> <vralphv@xxxxxxxxxxxxx> wrote:
>>
>>>I downloaded C# 2005 Express and downloaded sql 2005 Express at the same
>>>time.
>>>It installed without giving me a chance to set a password.
>>>I am able to connect to it using sqlcmd -E -S localhost\SQLEXPRESS but
>>>not if I use sqlcmd -S localhost\SQLEXPRESS -U and type in the password.
>>>I get
>>>Login failed for user 'sa' . The user is not associated with a trusted
>>>SQL
>>>Server
>>>connection.
>>>
>>>I set using ALTER LOGIN sa WITH PASSWORD = 'mypassword'
>>>Now I used an example program in c# for Java Developers, changing it a
>>>bit.
>>>I put in a connection string containing User ID=sa;PASSWORD=mypassword;
>>>I was able to connect to Northwind, but when I tried to select from table
>>>Customers it said invalid object 'Customers'.
>>>
>>>Then I connected with sqlcmd using the -E and then I created a Database
>>>called
>>>people, and made a table called person. Still problems inserting from
>>>the
>>>program
>>>and doing a select. So I removed the User ID=sa;PASSWORD=mypassword
>>>from the connection string, couldn't connect, then when I put it back I
>>>still
>>>couldn't connect, getting the same error. I can't figure out what is
>>>slightly different
>>>in the connection string.
>>>
>>>The connection string currently is
>>>
>>>string conStr = @"Data Source=.\SQLEXPRESS;" +
>>>"User ID=sa;PASSWORD=mypassword;" +
>>>"Database=people;" +
>>>"Integrated Security=True";
>>>
>>>The error is
>>>
>>>Cannot open database \"people\" requested by the login. The login failed.
>>>Login
>>>failed for user 'MDG-13E0564D3NC\\MDG User'.
>>>
>>>Also still get the same error using the -U option in sqlcmd.
>>>
>>>Do I need to make a login for 'MDG-13E0564D3NC\\MDG User'?
>>>How do I get sa associated with SQLEXPRESS?
>>>Searched in google and found advanced stuff that doesn't help
>>>
>>>Thanks,
>>>Ralph
>>>
>>>
>>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


.



Relevant Pages

  • Re: NT authentication vs. SQL auth
    ... that Windows Authentication is more "demanding" than is SQL Server ... I would think that SQL Server, rather than just looking at its own (probably ...
    (microsoft.public.sqlserver.security)
  • Re: NT authentication vs. SQL auth
    ... that Windows Authentication is more "demanding" than is SQL Server ... I would think that SQL Server, rather than just looking at its own (probably ...
    (microsoft.public.sqlserver.security)
  • Re: SBS 2000 + ASP.NET 1.1 + IIS Lockdown not working.
    ... Currently I am using Windows authentication. ... I will try SQL Server ... You can encrypt these string ...
    (microsoft.public.inetserver.iis.security)
  • Re: Need Help w/ SQLServer Express Authentication
    ... Windows Authentication can not be disabled using Mixed Authentication. ... You can only disable SQL Server authentication and Microsoft recommends using Windows Authentication when possible. ... Logins make your users to connect and perform their tasks in SQL Server. ...
    (microsoft.public.sqlserver.setup)
  • Windows Authentication with SQL Server running on Workgroup server machine
    ... I'm currently trying to understand SQL Server Windows Authentication ... The server is a machine named 'databaseserver' that runs SQL Server ...
    (microsoft.public.sqlserver.connect)