How the SQL Server port changes database connection

Source: Internet
Author: User
Tags port number server port
SQL Server ports, we can use the server-side Network trial tool and the client utility
To set, set the method is:
Use the server-side network trial tools and client utilities, respectively
Set the default port in-> TCP/IP-> properties for the protocol enabled by General Options->, assuming 1455
Then test your port for effectiveness and use
Telnet SQL Server address 1455
See if you can telnet, and if so, you can do the following tests
In the past, there is no port number in the writing, so it is better to write, but now change the port number, many friends are not very clear how to write the connection statement. The following database connection statement is the form after which the port is changed:
------------------------------
Set oconn = Server.CreateObject ("ADODB. Connection ")
sconn = "Driver={sql Server}"; server= server address, 1455;database= database; uid= user name; pwd= password; "
oConn.Open sconn
Response.Write oconn
-------------------------------
The output results are:
-------------------------------
PROVIDER=MSDASQL.1; Extended properties= "Driver=sql Server; server= server address, 1455; uid= user name; pwd= password; App=internet information Services; wsid=**;D atabase= Database "
-------------------------------
This indicates that we have successfully connected the data!


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.