Damon Combs
,
Greenhorn
Nov 15, 2016 14:46:41
When I try to connect SQL Server I get this error: database cannot be opened
I'm hoping someone here has experience in this and knows how to make sql db fix
Any help/advice would be appreciated,
Damon
Ron McLeod
,
Marshal
staff
Nov 15, 2016 19:31:35
How are you attempting to connect to the database - command line, Java/JDBC application, IDE such as Visual Studio, ???
Is there any more information in the error message? If there is, can you copy the complete message here?
Damon Combs
,
Greenhorn
Nov 16, 2016 13:43:13
I connect to data in a SQL Server database using the .NET Framework Data Provider for SQL Server.
Damon Combs
,
Greenhorn
Nov 16, 2016 13:44:20
There is no info, just annoying error : Database cannot be opened
Devesh Sharma
,
Greenhorn
Nov 18, 2016 20:59:27
Hi Damon,
Is the SQL Server local to your machine ?
Are you sysadmin on it (scary though) ?
If not a sysadmin, does your user exists in the Target database ?
And before all of the above, is the Database in Read/Write mode or is in Suspect state ?
You can take assistance of SQL DBA who can set you up with the necessary and sufficient privileges.
Knute Snortum
,
Sheriff
staff
Nov 19, 2016 07:21:52
Welcome to the Ranch, Devesh, and thank you for your contribution.
Wilson Scott
,
Greenhorn
Nov 21, 2016 14:40:45
Hello,
The solution to log on is: From the Connect to Server dialog, click Options. Change value of Connect to database: to any valid database on the server. The permanent solution to fix the server is to run SQL like: ALTER LOGIN [test ] WITH DEFAULT_DATABASE = master GO. Other method to troubleshoot this is - https://www.fixtoolbox.com/sqlserverfix.html
Best Regards
Damon Combs
,
Greenhorn
Nov 22, 2016 15:02:05
I want to say thank you for taking the time to share how to go about fixing this.
Paul Clapham
,
Marshal
staff
Nov 22, 2016 15:16:58
Damon, does that mean you've resolved the problem to your satisfaction?
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com