connection strings for sql server 2005

Provider Name connection string
(SQL Native Client 11.0 ODBC Driver) Driver={SQL Server Native Client 11.0};Server=servername;Database=dbname;Trusted_Connection=yes;
(Microsoft OLE DB Provider for SQL Server) Provider=SQLOLEDB.1;Data Source=servername\\instancename;Initial Catalog=dbname;Integrated Security=SSPI
(SQL Native Client 11.0) Provider=SQLNCLI11;Integrated Security=SSPI;Initial Catalog=dbname;Data Source=servername\\instancename;
(Microsoft OLE DB Provider for ODBC Drivers) Provider=MSDASQL.1;Persist Security Info=False;Data Source=DSN;DATABASE=dbname;ServerSPN=servername;

Connection String Keywords with SQL Server Native Client

ODBC Driver Connection String Keywords


Driver The keyword value for the SQL Server Native Client ODBC driver is "{SQL Server Native Client 11.0}"
DSN Name of an existing ODBC user or system data source. This keyword overrides any values that might be specified in the Server, Network, and Address keywords.
Server

The name of a SQL Server instance. The value must be either the name of a server on the network, an IP address, or the name of a SQL Server Configuration Manager alias.

The Address keyword overrides the Server keyword.

 Trusted_Connection  When "yes", instructs the SQL Server Native Client ODBC driver to use Windows Authentication Mode for login validation. Otherwise instructs the SQL Server Native Client ODBC driver to use a SQL Server username and password for login validation, and the UID and PWD keywords must be specified
 UID  A valid SQL Server login account. UID need not be specified when using Windows Authentication.

OLE DB Provider Connection String Keywords


 Database The database name
Integrated Security  Accepts the value "SSPI" for Windows Authentication.
 Password The SQL Server login password
Provider For SQL Server Native Client, this should be "SQLNCLI11"
for detail  goto link http://msdn.microsoft.com/en-us/library/ms130822.aspx
原文地址:https://www.cnblogs.com/sosoman/p/2591924.html