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 : [I][This question was asked by Boris Kofman][/I]
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
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
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:D
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:D
Cheers!
Kalayama
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
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