Re: Can no longer connect as sa



It works now, after I removed the password and user from the connection
string.
A book I read recommended mixed mode, but I don't know if I need that.
Thanks, Ralph

"Roger Wolter[MSFT]" <rwolter@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:O1abxdqCGHA.2040@xxxxxxxxxxxxxxxxxxxxxxx
> Is there a reason you need to connect using SQL authentication? SQL
> Express defaults to Windows authentication. If you really want to use SQL
> authentication, you will need to change the authentication to mixed mode
> and enable the SA login.
>
> --
> 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:E_3sf.84556$2k.58243@xxxxxxxxxxx
>> This post didn't show up 6 hours ago.
>>
>> 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 butnot
>> 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: Getting Challenged when using SQL connection on .aspx page
    ... What would happen if i removed integrated security=sspi from the connection ... Just want the login token to be passed, ... Have webpage with following connection in the ... I have account to the database on the SQL server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Syntax
    ... tablename above except that it is an mdb rather than a table in SQL server. ... Thus my connection table is now the mdb file name minus the ".mdb" extension ... the Access mdb connection string should be the variable name as ...
    (microsoft.public.sqlserver.dts)
  • Re: Unable to Locate Server
    ... I am using the copy of SQL Express that came with Visual Studio. ... > Boolean& failoverDemandDone, String host, String failoverPartner, String ... > owningObject, SqlConnectionString connectionOptions, String newPassword, ... >> trying to make a remote database connection while you think your database is ...
    (microsoft.public.sqlserver.setup)
  • Re: ADO connections question
    ... I have a module which creates the ADO connection object to validates the ... Function dbLogin(txtUser As String, txtPword As String, txtServer As String, ... I have a specific login form that calls the dbLogin function as shown below: ... Dim strCriteria As String ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Forms and ODBC connections
    ... This is a function I've used in the past to initiate a connection to to SQL ... I had login form that passed username and password to this function ... Public Function LoginBackendSQLUser(username As String, ...
    (microsoft.public.access.formscoding)