Summary of SQL Server database connectivity issues

Source: Internet
Author: User

TCP/IP connection failed for SQL Server 2008 connection to host over port 1433

1. Click Start-All Programs--Microsoft SQL Server2008---->sql server configuration manager-Select Left SQL Server 20 08 Network Configuration-double-click the MSSQLSERVER protocol and select TCP/IP right click to enable;

Configuring 1433 Ports

2. Database connection Settings

_connectionptr m_pconnection ("ADODB. Connection ");//define Database Connection object

M_pconnection.createinstance ("ADODB. Connection ");//Create Connection Object

Set the connection string, must be a BSTR type or _bstr_t type, if the database is on the network server is the shape (,3340)

_bstr_t strconnect = "provider=sqloledb; SERVER=,1433;DATABASE=AA; UID=AA; PWD=BB ";

HRESULT hr = M_pconnection->open (StrConnect, "", "", adModeUnknown);//null, adconnectunspecified,//Establish and server connection

This article is from the "Remote sensing application and Development" blog, please be sure to keep this source

Summary of SQL Server database connectivity issues

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: 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.