SQL Server Problems

Source: Internet
Author: User
Tags microsoft sql server 2005 management studio sql server management sql server management studio connectionstrings

When I used the reverse engineering of Visio today, I suddenly couldn't connect to the SQL Server database. The error code is as follows:

An error occurred while establishing a connection with the server. When you connect to SQL Server 2005, the default setting does not allow remote connection to SQL Server may cause this failure. (Provider: SQL network interface, error: 26-An error occurred while locating the specified server/instance) (Microsoft SQL Server, error:-1)

Then begin to check

First, choose Start> Microsoft SQL Server 2005. Then, select Configuration tools and open SQL Server Configuration Manager]

It is found that SQL Server (sqlexpress) is running normally, but SQL Server Browser is not enabled. Take a closer look, the service is disabled, so

Enter services. MSC in the command line to find the SQL Server Browser Service and open it.

Return to SQL Server Configuration Manager, open SQL Server Browser, link again, and run properly.

The following is the information collected on the Internet, but it does not solve this problem. However, it is well written and collected. Share it with you here.

An error occurred while establishing a connection with the server. When you connect to SQL Server 2005, the default setting does not allow remote connection to SQL Server may cause this failure. (Provider: named pipeline provider, error: 40-unable to open the connection to SQL Server)
Solution:

The database you may connect to is SQL Server 2005 express edition. From the "Start Menu", you can call up "SQL Server peripheral application configurator" in "configuration tool ". click "service and connect to the peripheral application configurator" and select the database instance ("sqlexpress" by default ", select "local connection and remote connection (using TCP/IP)" in "remote connection" of database engine to enable the remote connection of SQL Server 2005 (not allowed by default ).
You can
Configuration file:
<Connectionstrings>
<Add name = "testdbconnectionstring" connectionstring = "Data Source =. /sqlexpress; attachdbfilename = D:/wwwroot/ssztest1/app_data/testdb. MDF; Integrated Security = true; Connect timeout = 30; user instance = true "providername =" system. data. sqlclient "/>
</Connectionstrings>
Program call time:
Sqlconnection sqlcon = new sqlconnection (system. configuration. configurationsettings. deleettings ["testdbconnectionstring"]. tostring (); // testdbconnectionstring
Or both directly generate connection:
Sqlconnection sqlcon = new sqlconnection ("Data Source =. // sqlexpress; attachdbfilename = D: // wwwroot // ssztest1 // app_data // testdb. MDF; Integrated Security = true; Connect timeout = 30; user instance = true ")
As long as the connection is successful, it is not a problem to generate datasource again.

An error occurred while establishing a connection with the server. When you connect to SQL Server 2005, the default setting does not allow remote connection to SQL Server may cause this failure. (Provider: SQL network interface, error: 26-An error occurred while locating the specified server/instance)
First, make sure that SQL Server exprss is installed on the local computer and the SQL Server (sqlexpress) service is successfully started. If the problem persists, open "SQL Server peripheral application configurator" and select "service and connected peripheral application configurator ", then configure "remote connection" as "using TCP/IP and named pipes at the same time"

An error occurred while starting the process of the user instance. As a result, the user instance of SQL Server cannot be generated. The connection is closed.
Modify "user instance = true" in the connection string to "user instance = false.
For more information, see non-administrator user instances.

The file 'x:/website/app_data/database. MDF 'cannot be used as the database ''. Additional. The current command has a serious error. Discard any possible results.
You need to assign the "read" permission for the Users Group to the subfolders and files of the X and X partitions.

An error occurred while attempting to append the automatically named database to the file X:/website/app_data/database. MDF. A database with the same name already exists, or the specified file cannot be opened or located in the UNC shared directory.
It is preferred to confirm that the Users Group's "read" permission has been assigned to the subfolders and files of the X and X partitions. If the problem persists, use SQL Server Management studio to connect to the sqlexpress database instance and check whether the database named "Database" exists. If yes, separate the database with the same name.

The default database cannot be opened. Logon Failed.
User 'nt authority/network service' Logon Failed.
The read and write permissions of database file database. MDF are set to only available for network service. The solution is to stop the SQL Server (sqlexpress) service first, then integrate permissions from the parent item, and then start the SQL Server (sqlexpress) service again.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.