In the process of using SQL Server, the most common problem that users encounter is that they fail to connect. Generally speaking, there are two ways to connect SQL Server, one is to take advantage of SQL Server's own client tools, such as Enterprise Manager, Query Analyzer, transaction Profiler, and so on, the second is to use the user's own development of client programs, such as ASP scripts, VB programs, client programs are using ODBC or OLE DB for connection to SQL Server. Next, we'll talk about how to solve the problem of connection failure in terms of these two ways of connecting.
one, "SQL Server does not exist or access is denied"
(Figure 1)
"SQL Server does not exist or access denied" error, usually the most likely to occur, because the cause of the error is more, so need to check more aspects.
Generally speaking, there are several possibilities:
1, network connectivity issues;
2, SQL Server server problem;
3. Server-side network configuration problem;
4, the Client network configuration problem.
First, we check the network connection:
1, Ping the server IP address. First shut down the server and the client firewall, in order to exclude firewall software may be shielding the response to ping,telnet, etc. Then start ping the server IP address, if ping server IP address is not successful, indicating physical connection problems, this time to check hardware devices, such as network cards, HUB, routers and so on.
2, Ping the server name. If failure indicates a problem with name resolution, check to see if the Netbuis protocol is installed, and the DNS service is normal.
Second, use the Telnet command to check the working status of the SQL Server server. If the command succeeds, you can see the cursor flashing in the upper-left corner after the screen flashes, indicating that the SQL Server server is working properly and listening for TCP/IP connections on port 1433, and that the server does not start SQL if the command returns an error message "Cannot open connection" Server service, either the TCP/IP protocol is not enabled on the server side or the server is not listening on SQL Server's default port 1433.
Finally, we want to check the server, client network configuration. The server checks whether named pipes are enabled, whether the TCP/IP protocol is enabled, and so on. We can use SQL Server's own server network using tools to check.
Click: Program-> Microsoft SQL Server server network usage tool; When you open the tool, you can see in general what protocols are enabled by the server, and by default we enable Named Pipes and the TCP/IP protocol. TCP/IP protocol in dot, select "Properties", we can check the SQK Server service default port settings. Generally, we use SQL Server's default 1433 port. If "Hide Server" is selected, it means that the client cannot see the server by enumerating the servers, and it has a protective effect, but does not affect the connection. (Figure 2)
(Figure 3)
Next we go to the client to check the client's network configuration. We can also take advantage of the use of SQL Server's own client network tools to check, but this time it is on the client to run the tool. Click: After the program-> Microsoft SQL Server Client Network Use tool to open the tool, in the general item, you can see which protocols are enabled by the client. Again, we need to enable named Pipes and TCP/IP protocols. Click the TCP/IP protocol and select Properties to check the client default connection port settings, which must be consistent with the server.
(Figure 4)
Through the above several aspects of the inspection, basically can eliminate the first error.