MSSQL database server inaccessible

Source: Internet
Author: User

SQL Server does not exist or is denied access to the relevant solutions found on the Internet:
(A) 1: If you access the Internet independently, open port 21. enable port 1433 on the LAN.
2. Disable the firewall!
(B) Change sqllocalname = "(local)" of the database connection to an IP address. You can change (local) to 127.0.0.1 or an Internet IP address.
(C) Open the service, stop full-text retrieval and SQL Server services, enable SQL Server, and then enable full-text retrieval.
(D) Right-click SQL Server properties ==> the "ownership link:" allow cross-database ownership link "option must be checked (this operation requires restarting SQL Server ).
I tried the above method and it didn't play a role. Finally, I downloaded the SQL SP3 patch on Microsoft's website and installed it. Then I can install and run it normally.

Try to connect to the database in the following form

'SQL database connection parameters: Database Name (sqldatabasename), user password (sqlpassword), user name (sqlusername ),
'Connection name (sqllocalname) (local and foreign IP addresses)
Const sqldatabasename = "gym"
Const sqlpassword = "test"
Const sqlusername = "sa"
Const sqllocalname = "(local )"

Connstr = "provider = sqloledb; user id =" & sqlusername & "; Password =" & sqlpassword & "; initial catalog =" & sqldatabasename &"; data Source = "& sqllocalname &";"
On Error resume next
Set conn = server. Createobject ("ADODB. Connection ")
Conn. Open connstr
If err then
Err. Clear
Set conn = nothing
Response. Write "database connection error. Check the connection string. "
Response. End
End if
 

Important work of Intranet ing:
Sqlserver server --> Start Menu --> sqlserver --> server network utility --> enable Winsock Proxy --> proxy address: (sqlserver Server IP address) --> proxy port --> 1433 --> OK
 
Connect with an IP address

Key Points
1. Force port, do not use dynamic
2. Add a proxy

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.