jeudi, février 23, 2006

Cannot open user default database !!

today i was blocked by this error, i use SQL Server 2000. When attempting to connect to Microsoft SQL Server, you may see the following message : Cannot open user default database. To resolve that just execute this command to change the default databse for your user :

use master
go
sp_defaultdb ,
go

for example
use master
go
sp_defaultdb sa, master
go

uses any way to try to execute it : ODBC access, visual studio, even if you can do it use this ISQL methode :
1. Open an MS-DOS command prompt and change to the \Binn directory (by default in SQL Server 7.0, this is the Mssql7\Binn directory).
2. Type the following command to connect to SQL Server:
isql -U sa -P -S
3. At the 1> prompt, issue the appropriate command


that is all...Then connect to your Db!

Aucun commentaire: