Geeks Talk

Prepare for your Next Interview




Cannot open database error 4060

This is a discussion on Cannot open database error 4060 within the SQL Server forums, part of the Databases category; I've just downloaded VB 2005 Express and SQL server 2005 express.Built database and tryingto connect and open DB.My code is: Public p_conFirst As New SqlConnection() p_conFirst.ConnectionString = &...


Go Back   Geeks Talk > Databases > SQL Server

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 01-09-2007
Expert Member
 
Join Date: Oct 2006
Posts: 690
Thanks: 0
Thanked 49 Times in 41 Posts
JobHelper is on a distinguished road
Cannot open database error 4060

I've just downloaded VB 2005 Express and SQL server 2005 express.Built database and tryingto connect and open DB.My code is:

Public p_conFirst As New SqlConnection()
p_conFirst.ConnectionString = "Server=bk;Database=First;Trusted_Connection=True;"
p_conFirst.Open()
'error 4060

I was trying different connectionStrings,reinstallSql server,but have the same massage:"Cannot open database".

Maybe somebody has answerThanks,Boris

NOTE : [This question was asked by Boris Kofman]
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-11-2007
Expert Member
 
Join Date: Jun 2006
Posts: 140
Thanks: 2
Thanked 12 Times in 9 Posts
Jim.Anderson is on a distinguished road
Re: Cannot open database error 4060

Boris,

few things...

1. Check to see if sql server is running ...
2. what kind of authentication did you select .. mixed or windows ..
3. if it's mixed, you can use the following connection string
4. if it's windows, you windows user account needs to have permission for sql server .. go to users option form management sudio, add your name as dbowner and assing default database...
5. did you create "First" database ..?

Let me know ...

Jim
Reply With Quote
  #3 (permalink)  
Old 01-15-2007
Junior Member
 
Join Date: Jan 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Boris Kofman is on a distinguished road
Re: Cannot open database error 4060

Hi Jim
I am sorry but i am not a professional so many things are not clear for me.
1.How can I be sure that server is running?
2.I have no idea what kind of authentication did I select .. mixed or windows
3.In my Express Edition there is no management studio utility to set permeation to server,at least I could not find this place.
4.Yes I did create "First",but was testing different DB's with the same result
Thank you ,Jim

boris
Reply With Quote
  #4 (permalink)  
Old 01-15-2007
Expert Member
 
Join Date: Sep 2006
Location: Bengalooru (Formerly called Bangalore), India
Posts: 486
Thanks: 2
Thanked 28 Times in 27 Posts
kalayama is on a distinguished road
Re: Cannot open database error 4060

1) To cherck if the server is running, you can check it in taskmanager>processes. Or go to Control Panel>Administrative Tools>Services and check for SQL Server Service.
2)While installing the SQL server, it will usually ask which type of authentication to be used. I don't remember SQL Server Express Edition asking anything like this. So, I guess, by default you authentication will be Mixed.
3)You can Download server management studio Express Edition from Microsoft and install

Well, I don't have SQLServer installed in tyhis machine of mine. Will check and post if I find out anything after 10hrs.

Hope your problem gets solved befor that

Cheers!
Kalayama
__________________
[COLOR="Blue"][SIZE="2"]"If you are not living on the edge of your life, you are wasting space"[/SIZE][/COLOR]

Someone says "Impossible is nothing". The man next him says "Let me see you licking your elbow tip!"
Reply With Quote
  #5 (permalink)  
Old 01-16-2007
Junior Member
 
Join Date: Jan 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Boris Kofman is on a distinguished road
Re: Cannot open database error 4060

Yes,server is running.download server management studio.But it doesn't want
to axcept any changes,where Windows Authentication.
Boris
Reply With Quote
  #6 (permalink)  
Old 01-17-2007
Expert Member
 
Join Date: Dec 2006
Location: India
Posts: 140
Thanks: 0
Thanked 6 Times in 4 Posts
nikhil_rattan is on a distinguished road
Re: Cannot open database error 4060

Hi, 1. On the server, click start, all programs, soapware, server and finally datamanager. 2. Login to your server using the sa account by clicking ok. 3. Most sa accounts don't have passwords assigned to them. If a blank password doesn't work, consult your system administrator to find the password. Once the datamanager is open, from the menu item choose actions, add soapware account. You should then receive the notice "soapware user account added". Click ok. 4. Close the datamanager. 5. Try to run soapware. If your using sql standard or enterprise without the datamanager, see note below. Note: for those who are using sql standard and don't want to install or use the data manager, you can add the soapuser account manually to each database using "enterprise manager. The username is "soapuser" and the password is "soapware". The database user properties/rights for the soapuser account should be public, db_ddladmin, db_datareader and db_datawriter. If using nt authentication, each user will need the same access to the databases. Sql administration is not in the scope of the docs, inc. Support agreement. Only sql administrators should attempt adding account information or altering account information. Incorrectly setting account information can render databases and servers unusable. Regards nikhil rattan
Reply With Quote
Reply

  Geeks Talk > Databases > SQL Server


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
How do we know which error is generated? JobHelper QTP 1 02-28-2008 07:06 AM
Cannot open registry key JobHelper Data Warehousing 0 01-09-2007 06:15 AM
December 2006 : Member of the Month Contest Open admin Site News & Announcements 0 12-02-2006 10:28 AM
Compilation error JobHelper SQL 0 11-28-2006 09:37 AM
Microsoft CRM : Notify salespeople of open cases Jim.Anderson Microsoft CRM 0 09-27-2006 07:39 AM


All times are GMT -4. The time now is 04:44 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved