Set permission for SQL login id

In sql i want to set the permission , tht others r not allowed to access my database.I set login id for tht, but if they login in other database (in SQL query analyzer) thn they hav the option to change the database in the dropdown in sql query analyzer . So i want to stop that.

if they try to access my database, then i want to display "U hav no permission to access this".

Hi, I guess you are using SQL Srver 2000 if yes then open "Enterprise Manager" Select your Database ->Security->Logins->Righr click on the user->Properties->Database Access Tab->Select the Database you want to give permission for the user.

during the login creation itself i selected tht database.After that i select db_owner and try to unchecked tht public option in database roles grid(second one in database access tab ) it shows message like "members cannot be dropped from public ".