You receive a "Cannot open user default database <ID>. Using master database instead." error message when you connect to a SQL Server database (259561)



The information in this article applies to:

  • Microsoft SQL Server 7.0
  • Microsoft SQL Server 2000 (all editions)
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Express Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Workgroup

This article was previously published under Q259561

SYMPTOMS

After you add a Microsoft Windows NT group as a SQL Server login you might see the following error message when you log on as a member of that Windows NT group, even if the group has permission to their default database:
Msg 4062 Severity 11 Cannot open user default database <ID>. Using master database instead.
If the client is using an ODBC or OLEDB-based connection, the client will not be able to log on to SQL Server as the error message suggests. If the connection is DB-Library-based, the client will be able to successfully log on to SQL Server and be in the master database.

196076 PRB: "Cannot open default database <ID>. Using master instead."

CAUSE

The error message may occur if the Windows NT group or ANY other group of which you are a member meets one of these conditions:
  • The group does not have access to the database that is set as their default database.
  • The database that is set as the group's default database is in "dbo use only" mode.
  • The group's default database has been dropped.
If you are a member of a group that meets one of the previous conditions, the error message might occur regardless of how many valid groups in which you are a member.

These conditions are described in more detail in the article referenced in the "Symptoms" section of this article.

WORKAROUND

The System Administrator should correct the group login that meets any one of the conditions listed in the "Cause" section of this article.

For example, if you are a member of a group that does not have access to its default database, the system administrator should either give the group the correct permissions, or change the default database to a database to which the group has permission.

Modification Type:MajorLast Reviewed:12/13/2005
Keywords:kbprb KB259561