locked
Cannot open user default database. Login failed.Login failed for user 'abc'. (.Net SqlClient Data Provider), Because login was deleted RRS feed

  • Question

  • Cannot show requested dialog.

    ===================================

    Cannot show requested dialog. (SqlMgmt)

    ------------------------------
    Program Location:

       at Microsoft.SqlServer.Management.SqlMgmt.DefaultLaunchFormHostedControlAllocator.AllocateDialog(XmlDocument initializationXml, IServiceProvider dialogServiceProvider, CDataContainer dc)
       at Microsoft.SqlServer.Management.SqlMgmt.DefaultLaunchFormHostedControlAllocator.Microsoft.SqlServer.Management.SqlMgmt.ILaunchFormHostedControlAllocator.CreateDialog(XmlDocument initializationXml, IServiceProvider dialogServiceProvider)
       at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
       at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(XmlDocument doc, IServiceProvider provider)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolsMenuItem.OnCreateAndShowForm(IServiceProvider sp, XmlDocument doc)
       at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()

    ===================================

    Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)

     Program Location:

       at Microsoft.SqlServer.Management.Smo.Enumerator.Process(Object connectionInfo, Request request)
       at Microsoft.SqlServer.Management.SqlManagerUI.CreateLogin.CheckObjects(String login)
       at Microsoft.SqlServer.Management.SqlManagerUI.CreateLogin..ctor(CDataContainer context)

    ===================================

    Failed to connect to server JANET. (Microsoft.SqlServer.ConnectionInfo)

    ------------------------------
    Program Location:

       at Microsoft.SqlServer.Management.Common.ConnectionManager.Connect()
       at Microsoft.SqlServer.Management.Common.ConnectionManager.get_ServerVersion()
       at Microsoft.SqlServer.Management.Smo.SqlServer.GetServerVersion(Object conn)
       at Microsoft.SqlServer.Management.Smo.Environment.GetServerVersion(Urn urn, Object ci)
       at Microsoft.SqlServer.Management.Smo.Environment.GetObjectsFromCache(Urn urn, Object ci)
       at Microsoft.SqlServer.Management.Smo.Environment.GetData(Request req, Object ci)
       at Microsoft.SqlServer.Management.Smo.Enumerator.GetData(Object connectionInfo, Request request)
       at Microsoft.SqlServer.Management.Smo.Enumerator.Process(Object connectionInfo, Request request)

    ===================================

    Cannot open user default database. Login failed.
    Login failed for user 'JANET\WINXP'. (.Net SqlClient Data Provider)

     ------------------------------
    Server Name: JANET
    Error Number: 4064
    Severity: 11
    State: 1
    Line Number: 65536


    ------------------------------
    Program Location:

       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at Microsoft.SqlServer.Management.Common.ConnectionManager.InternalConnect(WindowsIdentity impersonatedIdentity)
       at Microsoft.SqlServer.Management.Common.ConnectionManager.Connect()

     

    Friday, December 11, 2009 5:18 AM

All replies

  • Could you please check wethere the default database exists or it might be set to either single user mde or restricted_user state . 

    Cause of this issue is

    Is in suspect mode.
    No longer exists.
    Is in single user mode and the only available connection is already being used by someone else or by something else.
    Has been detached.
    Has been set to the RESTRICTED_USER state.
    Is offline.
    Is set to emergency status.
    Does not have the login account mapped to a user or the user has been denied access.
    Is part of a database mirror.

    Please refer the KB : http://support.microsoft.com/kb/307864 " Workaround is provided "

    Where as you can solve this issue by specifiying another database as default

    Example :

    sqlcmd -E -d databasename
    then issue the ALTER LOGIN statement.
    It's the "-d databasename" is the main point  - it specifies that the connection should be made to the specified database name , so the login won't try to connect to the database that no longer exists.

    -------------
    Thanks,Suhas V
    Friday, December 11, 2009 5:35 AM
  • For Suhas V or someone else,

    Initially I wanted to create a password for the security of data in sql server management studio, so that the sql server management studio can not be opened by someone else, after a password set on the sql server management studio, it still can be opened without a assword. Then I started to delete login names in server name> security> logins> login names, since that I could not open the database.
    please note that I am working on my own computer, for my own purposes, so no one else in my computer
     
    Thank you,bdenmy

    Friday, December 11, 2009 8:02 AM