Connect Localhost to database

Source: Internet
Author: User
Tags string back
I went to the customer to implement Localhost and database connection a few days ago and installed our software on a newly installed machine. The configuration is as follows: Operating System: windows2003 Database: SQLSERVER2000 supporting environment:. NETFRAMEWORK1.1 after the application software is installed, the system prompts that the database connection fails. The server localhost,

I went to the customer to implement Localhost and database connection a few days ago and installed our software on a newly installed machine. The configuration is as follows: Operating System: windows2003 Database: SQL SERVER 2000 supporting environment: After the. NET FRAMEWORK 1.1 application software is installed, the system prompts that the database connection fails. Server = localhost,

Connect Localhost to database

A few days ago, I went to the customer and installed our software on a newly installed machine. The configuration is as follows:

Operating System: windows2003

Database: SQL SERVER 2000

Supported environment:. net framework 1.1

After the application software is installed, the system prompts "database connection failed" upon login ". The server = localhost, that is, the local machine, and the database name is correct. Strange.

I have never encountered this problem before. In principle, SQL SERVER is installed on the local machine, and no MDAC is installed. Is there any other problem? I tried several more times and still failed.

Accidentally changed localhost to the machine name on the local machine, but the connection was successful!

Why?

I found that there was always a Red Cross in the network connection in the tray area. When I clicked on it, I was prompted that the Network was not connected. It may be related to this. In fact, the network card has been installed, but the network cable is not connected. Connect to the network cable, connect to the network, and change the database connection string back to "server = localhost". The connection is successful.

It seems that localhost has a lot to do with the network. Although it represents local, it is a network object, or it is a name that only applies to the network. Therefore, "server = localhost" and "server = Local Machine name" are sometimes not necessarily equal.

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.