Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Setup / December 2005

Tip: Looking for answers? Try searching our database.

Cannot connect using sa

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ralph - 26 Dec 2005 23:56 GMT
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
Sue Hoegemeier - 27 Dec 2005 13:36 GMT
Make sure you have it configured to allow both SQL Server
and Windows authentication. Looks like it might be set to
Windows authentication only.

-Sue

>I downloaded C# 2005 Express and downloaded sql 2005 Express at the same
>time.
[quoted text clipped - 44 lines]
>Thanks,
>Ralph
ralph - 27 Dec 2005 16:41 GMT
> 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
>
[quoted text clipped - 48 lines]
>>Thanks,
>>Ralph
Roger Wolter[MSFT] - 28 Dec 2005 16:48 GMT
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.

Signature

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

>> Make sure you have it configured to allow both SQL Server
>> and Windows authentication. Looks like it might be set to
[quoted text clipped - 62 lines]
>>>Thanks,
>>>Ralph
Sue Hoegemeier - 29 Dec 2005 05:06 GMT
You probably would want to explicitly tell the connection
string use Windows Authentication - include:
Integrated Security=SSPI
in your connection string to use Widows Authentication.

-Sue

>I found an article in MSDN telling how to change authentication
>in SQL Server Management Studio.  I don't have that.
[quoted text clipped - 4 lines]
>
>Ralph
jdiego.mail@gmail.com - 29 Dec 2005 12:33 GMT
Hi All,

I had the same problem and I fixed it by enabling "SQL Server and
Windows Authentication Model"

Now I can connect by using SQL Server Management Studio Express in
local, but when I try to remote connect by using SQL Analyzer I get
error 18456.

Well, I am using a new user called 'test' for connecting SQL server. I
don't know the 'sa' password and i am confident about if it is a good
idea to change the 'sa' password.

Is 'sa' used by the system is some way?

The server is not in either: the local network, workgroup nor domain.
Therefore i am using SQL Authentication for login.

I am connecting by typing just the server IP address. It means that I
am not using the instance name (SQLExpress) at all. is that correct?

Since I can connect the SQLServer but the user is being refused, from
my point of view the problem could be:
- SQL Authentication has not been property activated for remote access
- Remote connection is not accessing to the correct instance:
SQLExpress (The only one)
- The user 'test' had not been property initialized.

Obviously I am beginner and I would appreciate you help very much.

Thanks in advance.
  Diego
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.