Configuration of the SQL Server database connected to the LAN, sqlserver

Source: Internet
Author: User
Tags how to connect to sql server

Configuration of the SQL Server database connected to the LAN, sqlserver

First, make sure that the two machines are located in the same LAN, and then enable the configuration tool → SQL Server Configuration Manager to configure the TCP/IP IP (IP1, IP2) of the MSSQLSERVER protocol) change the TCP port to 1433, and enable the port to yes.

Server Name: Enter IP Address

Login Name: Enter the database account

Password: Enter the password of the database account

Description: It has no relationship with the Remote Desktop Connection, but it is related to the system firewall. You must use SQL Server or directly close the firewall.


How can asp remotely connect to the SQL server database outside the lan?

Select one of the three methods you are familiar:
(1) using odbc:
ADO (ActiveX Data Objects) provides a Connection object that can be used to establish and manage connections between applications and ODBC databases. Connection objects have various attributes and Methods. You can use them to open and close database connections. To write a database Connection script, first create an instance of the Connection object and then open the database Connection:
<%
Set conn = server. createobject ("adodb. connection ")
Conn. open "DSN = ODBC name; Database = Database name; UID =; PWD = ;"
%>
(2) establish a connection through oledb

Using the oledb method to establish a connection between the page and the database, you do not need to create an odbc dsn data source. Writing the following script to establish a connection with the data source is a simple and easy-to-use method.
<%
Set conn = server. createobject ("adodb. connection ")
Conn. open "Provider = SQLOLEDB; server = SQL server name or IP address; database = database name; uid =; pwd ="
%>

(3) establish a connection through the driver

You do not need to create an odbc dsn data source to establish a connection between the page and the database through the driver, but you must know the actual database file path or data source name (for example, SQLserver database ).
<%
Set conn = server. createobject ("adodb. connection ")
Conn. open "driver = {SQL server}; server = SQL server name or IP address; database = database name; uid =; pwd =" %>

C #: how to connect to SQL server in the LAN

Yes ..

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.